summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 31ff134)
raw | patch | inline | side by side (parent: 31ff134)
author | Hao Zhang <hzhang@ti.com> | |
Fri, 10 Jun 2011 14:48:25 +0000 (10:48 -0400) | ||
committer | Hao Zhang <hzhang@ti.com> | |
Fri, 10 Jun 2011 14:48:25 +0000 (10:48 -0400) |
67 files changed:
diff --git a/bin2ccs/README.txt b/bin2ccs/README.txt
--- a/bin2ccs/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Utility to convert binary file to TI CCS Format file
-
-Usage:
-
-Under Windows Command Prompt, run bin2ccs.bat or the following command:
-bin2ccs <infile> <outfile>
-
-Note: The infile is the input binary image or data file, the outfile is the generated output file
- in CCS data format that can be loaded into DSP memory using the CCS Memory Browser.
-
-Example: bin2ccs app.out app.dat
-
-
diff --git a/bin2ccs/bin2ccs.bat b/bin2ccs/bin2ccs.bat
--- a/bin2ccs/bin2ccs.bat
+++ /dev/null
@@ -1 +0,0 @@
-bin2ccs app.out app.dat
diff --git a/bin2ccs/bin2ccs.c b/bin2ccs/bin2ccs.c
--- a/bin2ccs/bin2ccs.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-*/
-
-/**********************************************************************************************
- * FILE PURPOSE: Convert a binary file to CCS format
- **********************************************************************************************
- * FILE NAME: bin2ccs.c
- *
- * DESCRIPTION: The binary file is converted to an ascii file in CCS data format
- *
- **********************************************************************************************/
-
-#include <stdio.h>
-#include <malloc.h>
-
-char version[] = "1.0.0.0";
-
-/**********************************************************************************************
- * FUNCTION PURPOSE: Form a 32 bit value from an unsigned byte array
- **********************************************************************************************
- * DESCRIPTION: The value is formed and padded if required
- **********************************************************************************************/
-unsigned int formInt (unsigned char *c, unsigned int i, unsigned int len)
-{
- unsigned int x = 0;
-
- if (i < len)
- x = x | (c[i] << 24);
-
- if ((i+1) < len)
- x = x | (c[i+1] << 16);
-
- if ((i+2) < len)
- x = x | (c[i+2] << 8);
-
- if ((i+3) < len)
- x = x | c[i+3];
-
- return (x);
-
-}
-
-int main (int argc, char *argv[])
-{
- FILE *fil;
- unsigned char *cdat;
- unsigned int len;
- unsigned int i;
-
- printf("Binary to CCS Format Converter Version %s\n", version);
-
- if (argc != 3) {
- fprintf (stderr, "usage: %s infile outfile\n", argv[0]);
- return (-1);
- }
-
- fil = fopen (argv[1], "rb");
- if (fil == NULL) {
- fprintf (stderr, "%s: Failed to open input file %s\n", argv[0], argv[1]);
- return (-1);
- }
-
- fseek (fil, 0, SEEK_END);
- len = ftell (fil);
- fclose (fil);
-
- cdat = malloc (len * sizeof (unsigned char));
- if (cdat == NULL) {
- fprintf (stderr, "%s: Failed to malloc %d bytes\n", argv[0], len);
- return (-1);
- }
-
- fil = fopen (argv[1], "rb");
- if (fil == NULL) {
- fprintf (stderr, "%s: Failed to open input file %s\n", argv[0], argv[1]);
- return (-1);
- }
-
- fread (cdat, sizeof(unsigned char), len, fil);
-
- fclose (fil);
-
-
- fil = fopen (argv[2], "w");
- if (fil == NULL) {
- fprintf (stderr, "%s: Error opening output file %s\n", argv[0], argv[1]);
- free (cdat);
- return (-1);
- }
-
- /* The ccs header */
- fprintf (fil, "1651 1 80000000 1 %x\n", (len + 3) / 4);
-
-
- /* The data */
- for (i = 0; i < len; i += 4)
- fprintf (fil, "0x%08x\n", formInt(cdat, i, len));
-
-
- fclose (fil);
- free (cdat);
-
- return (0);
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/bin2ccs/bin2ccs.exe b/bin2ccs/bin2ccs.exe
deleted file mode 100644 (file)
index 493588b..0000000
Binary files a/bin2ccs/bin2ccs.exe and /dev/null differ
index 493588b..0000000
Binary files a/bin2ccs/bin2ccs.exe and /dev/null differ
index 4d0661971c59baac34c3e10e18fd6203a85d8815..c6cfa13edf5e6bdaa86cd5987ea2831d5c443a8c 100644 (file)
--- a/boot_loader/IBL_buildibl
+++ b/boot_loader/IBL_buildibl
cd ibl/src/make
source setupenvMsys.sh
-make evm_c667x_i2c ENDIAN=little I2C_BUS_ADDR=0x51
+make evm_c6678_i2c ENDIAN=little I2C_BUS_ADDR=0x51
+cp -f ibl_c66x/i2crom.dat ../../../i2crom_0x51_c6678_le.dat
+cp -f ../util/i2cConfig/i2cparam_c66x_le.out ../../../i2cparam_0x51_c6678_le_0x500.out
+make clean
+
+make evm_c6670_i2c ENDIAN=little I2C_BUS_ADDR=0x51
+cp -f ibl_c66x/i2crom.dat ../../../i2crom_0x51_c6670_le.dat
+cp -f ../util/i2cConfig/i2cparam_c66x_le.out ../../../i2cparam_0x51_c6670_le_0x500.out
+make clean
+
+mv -f ../../../i2crom_0x51_c6678_le.dat bin/i2crom_0x51_c6678_le.dat
+mv -f ../../../i2crom_0x51_c6670_le.dat bin/i2crom_0x51_c6670_le.dat
+mv -f ../../../i2cparam_0x51_c6678_le_0x500.out bin/i2cparam_0x51_c6678_le_0x500.out
+mv -f ../../../i2cparam_0x51_c6670_le_0x500.out bin/i2cparam_0x51_c6670_le_0x500.out
cd ../../../
diff --git a/boot_loader/examples/emac/Ethernet_boot/README b/boot_loader/examples/emac/Ethernet_boot/README
+++ /dev/null
@@ -1,18 +0,0 @@
-/****** Steps to send the image from the Host to the target DSP. ***********/
-
-1. Boot the target the DSP in Ethernet boot mode.
-
-2. Once the DSP boots up, it transmits BOOTP packet at regular interval which will have the MAC id of the DSP.
-
-3. Create a image of the simple code in the simple folder using the "make simple.eth".
-
-4. The resulting simple.eth file is the desired image.
-
-5. Add an ARP entry for the DSP mac address associating with an IP local to the host. For example if the host PC's
-IP is 192.168.1.1, then add an ARP entry with the DSP's MAC address associated with IP address 192.168.1.2.
-
-5. Use the pcsendpkt.exe to send the image to the DSP using the associated IP address. For example
-pcsendpkt.exe simple.eth 192.168.1.2
-
-6. In order to compile the pcsendpkt.c file please compile with -lwsock32 option for using windows socket.
-
diff --git a/boot_loader/examples/emac/Utilities/b2ccs.c b/boot_loader/examples/emac/Utilities/b2ccs.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Convert a hex b file into a ccs data file */
-
-#include <stdio.h>
-#include <malloc.h>
-
-
-int asciiByte (unsigned char c)
-{
- if ((c >= '0') && (c <= '9'))
- return (1);
-
- if ((c >= 'A') && (c <= 'F'))
- return (1);
-
- return (0);
-}
-
-int toNum (unsigned char c)
-{
- if ((c >= '0') && (c <= '9'))
- return (c - '0');
-
- return (c - 'A' + 10);
-
-}
-
-
-void stripLine (FILE *s)
-{
- char iline[132];
-
- fgets (iline, 131, s);
-
-}
-
-/* Read a .b file. */
-unsigned long readBFile (FILE *s, unsigned char *data, unsigned long maxSize)
-{
- unsigned char x, y;
- unsigned long byteCount = 0;
-
- /* Strip the 1st two lines */
- stripLine (s);
- stripLine (s);
-
- for (;;) {
-
- /* read the 1st ascii char */
- do {
- x = fgetc (s);
- if (x == (unsigned char)EOF)
- return (byteCount);
-
- } while (!asciiByte(x));
-
- /* Read the next ascii char */
- y = fgetc (s);
- if (y == (unsigned char)EOF)
- return (byteCount);
- if (asciiByte(y))
- data[byteCount++] = (toNum(x) << 4) | toNum (y);
-
- if (byteCount >= maxSize) {
- fprintf (stderr, "Max input array size exceeded\n");
- return (-1);
- }
- }
-}
-
-
-unsigned dwordConvert (unsigned char *data, unsigned long idx, unsigned long iMax)
-{
- unsigned value;
- unsigned char c[4];
- int i;
-
- c[0] = c[1] = c[2] = c[3] = 0;
-
- for (i = 0; i < 4; i++) {
- if (idx >= iMax)
- break;
- c[i] = data[idx++];
- }
-
- value = c[3] | (c[2] << 8) | (c[1] << 16) | (c[0] << 24);
-
- return (value);
-
-}
-
-
-
-#define SIZE (1024 * 1024 * 2) /* max array size 2MB */
-
-int main (int argc, char *argv[])
-{
- FILE *strin;
- FILE *strout;
-
- unsigned char *dataSet1;
-
- unsigned char block[128];
- unsigned blockSize;
-
- unsigned long pIn;
- unsigned long pOut;
-
- unsigned long inSize;
- unsigned long i;
-
- /* Arg check */
- if (argc != 3) {
- fprintf (stderr, "usage: %s infile outfile\n", argv[0]);
- return (-1);
- }
-
- /* Open the input file */
- strin = fopen (argv[1], "r");
- if (strin == NULL) {
- fprintf (stderr, "%s: Could not open file %s for reading\n", argv[0], argv[1]);
- return (-1);
- }
-
- /* Allocate the two data set memories */
- dataSet1 = malloc (SIZE * sizeof (unsigned char));
- if (dataSet1 == NULL) {
- fprintf (stderr, "%s: Malloc failure\n", argv[0]);
- return (-1);
- }
-
- /* Read the data into the byte stream */
- if ((inSize = readBFile (strin, dataSet1, SIZE)) < 0)
- return (inSize);
- fclose (strin);
-
- strout = fopen (argv[2], "w");
- if (strout == NULL) {
- fprintf (stderr, "%s error: Could not open output file %s\n", argv[0], argv[2]);
- free (dataSet1);
- return (-1);
- }
-
- /* Write the CCS header */
- fprintf (strout, "1651 1 10000 1 %x\n", (inSize + 3) / 4);
-
- /* Write out each 32 bit line. */
- for (i = 0; i < inSize; i += 4)
- fprintf (strout, "0x%08x\n", dwordConvert (dataSet1, i, inSize));
-
- free (dataSet1);
- fclose (strout);
-
-
- return (0);
-
-}
-
-
-
-
-
-
-
-
diff --git a/boot_loader/examples/emac/Utilities/b2ccs.exe b/boot_loader/examples/emac/Utilities/b2ccs.exe
deleted file mode 100644 (file)
index b11083e..0000000
Binary files a/boot_loader/examples/emac/Utilities/b2ccs.exe and /dev/null differ
index b11083e..0000000
Binary files a/boot_loader/examples/emac/Utilities/b2ccs.exe and /dev/null differ
diff --git a/boot_loader/examples/emac/Utilities/b2i2c.c b/boot_loader/examples/emac/Utilities/b2i2c.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Create an ascii hex i2c data file */
-
-#include <stdio.h>
-#include <malloc.h>
-
-unsigned onesComplementAdd (unsigned value1, unsigned value2)
-{
- unsigned result;
-
- result = (unsigned)value1 + (unsigned)value2;
-
- result = (result >> 16) + (result & 0xFFFF); /* add in carry */
- result += (result >> 16); /* maybe one more */
- result = (result & 0xffff);
- return (unsigned)result;
-
-} /* end of beth_ones_complement_add() */
-
-
-int asciiByte (unsigned char c)
-{
- if ((c >= '0') && (c <= '9'))
- return (1);
-
- if ((c >= 'A') && (c <= 'F'))
- return (1);
-
- return (0);
-}
-
-int toNum (unsigned char c)
-{
- if ((c >= '0') && (c <= '9'))
- return (c - '0');
-
- return (c - 'A' + 10);
-
-}
-
-
-void stripLine (FILE *s)
-{
- char iline[132];
-
- fgets (iline, 131, s);
-
-}
-
-/* Read a .b file. */
-unsigned long readBFile (FILE *s, unsigned char *data, unsigned long maxSize)
-{
- unsigned char x, y;
- unsigned long byteCount = 0;
-
- /* Strip the 1st two lines */
- stripLine (s);
- stripLine (s);
-
- for (;;) {
-
- /* read the 1st ascii char */
- do {
- x = fgetc (s);
- if (x == (unsigned char)EOF)
- return (byteCount);
-
- } while (!asciiByte(x));
-
- /* Read the next ascii char */
- y = fgetc (s);
- if (y == (unsigned char)EOF)
- return (byteCount);
- if (asciiByte(y))
- data[byteCount++] = (toNum(x) << 4) | toNum (y);
-
- if (byteCount >= maxSize) {
- fprintf (stderr, "Max input array size exceeded\n");
- return (-1);
- }
- }
-}
-
-
-int copyBlock (unsigned char *source, unsigned long idx, unsigned long maxSize,
- unsigned char *dest, unsigned long count)
-{
- unsigned long i;
-
- for (i = 0; i < count; i++) {
- if (idx >= maxSize)
- break;
-
- dest[i] = source[idx++];
- }
-
- return (i);
-
-}
-
-void blockCheckSum (unsigned char *block, unsigned long blockSize)
-{
- unsigned checksum = 0;
- unsigned value;
- unsigned long i;
-
- if (blockSize & 0x0001) {
- fprintf (stderr, "program requires an even blocksize\n");
- exit (-1);
- }
-
- for (i = 0; i < blockSize; i += 2) {
- value = (block[i] << 8) | block[i+1];
- checksum = onesComplementAdd (checksum, value);
- }
-
- /* Put the checksum into the block starting at byte 2. Use big endian */
- checksum = ~checksum;
- block[3] = checksum & 0xff;
- block[2] = (checksum >> 8) & 0xff;
-
-}
-
-#define SIZE (1024 * 1024 * 2) /* max array size 2MB */
-
-int main (int argc, char *argv[])
-{
- FILE *strin;
- FILE *strout;
-
- unsigned char *dataSet1;
- unsigned char *dataSet2;
-
- unsigned char block[128];
- unsigned blockSize;
-
- unsigned long pIn;
- unsigned long pOut;
-
- unsigned long inSize;
- unsigned long i;
-
- /* Arg check */
- if (argc != 3) {
- fprintf (stderr, "usage: %s infile outfile\n", argv[0]);
- return (-1);
- }
-
- /* Open the input file */
- strin = fopen (argv[1], "r");
- if (strin == NULL) {
- fprintf (stderr, "%s: Could not open file %s for reading\n", argv[0], argv[1]);
- return (-1);
- }
-
- /* Allocate the two data set memories */
- dataSet1 = malloc (SIZE * sizeof (unsigned char));
- dataSet2 = malloc (SIZE * sizeof (unsigned char));
- if ((dataSet1 == NULL) || (dataSet2 == NULL)) {
- fprintf (stderr, "%s: Malloc failure\n", argv[0]);
- return (-1);
- }
-
- /* Read the data into the byte stream */
- if ((inSize = readBFile (strin, dataSet1, SIZE)) < 0)
- return (inSize);
- fclose (strin);
-
- /* Perform the i2c block formatting. The block size will be fixed at 128 bytes,
- * 2 bytes of length, 2 bytes checksum, 124 bytes of data. */
- pIn = 0;
- pOut = 0;
-
- do {
-
- /* Copy the block, leave 4 bytes at the top */
- blockSize = copyBlock (dataSet1, pIn, inSize, &block[4], 124);
- pIn += blockSize; /* advance to next data in source */
-
- if (blockSize) {
- blockSize += 4; /* Add room for the header - big endian */
- block[1] = blockSize & 0xff;
- block[0] = (blockSize >> 8) & 0xff;
- block[2] = block[3] = 0;
-
- /* Checksum the block */
- blockCheckSum (block, blockSize);
-
- /* Copy the results to the destination block */
- if ((pOut + blockSize) >= SIZE) {
- fprintf (stderr, "%s: destination array size exceeded\n", argv[0]);
- return (-1);
- }
- for (i = 0; i < blockSize; i++)
- dataSet2[pOut++] = block[i];
- }
-
- } while (blockSize == 128);
-
-
- /* Copy the resulting data set into the output file in ccs format */
- strout = fopen (argv[2], "w");
- if (strout == NULL) {
- fprintf (stderr, "%s: Could not open %s for writing\n", argv[0], argv[2]);
- return (-1);
- }
-
-
- /* Write the two line header */
- fprintf (strout, "%c\n$A000000\n", (unsigned char)2);
-
- /* Write out the data */
- for (i = 0; i < pOut; i++) {
- if ( ((i+1)%24) )
- fprintf (strout, "%02X ", dataSet2[i]);
- else
- fprintf (strout, "%02X\n", dataSet2[i]);
- }
-
- /* Write the close character */
- fprintf (strout, "\n%c", (unsigned char)3);
-
- fclose (strout);
-
- return (0);
-
-}
diff --git a/boot_loader/examples/emac/Utilities/b2i2c.exe b/boot_loader/examples/emac/Utilities/b2i2c.exe
deleted file mode 100644 (file)
index a1d1822..0000000
Binary files a/boot_loader/examples/emac/Utilities/b2i2c.exe and /dev/null differ
index a1d1822..0000000
Binary files a/boot_loader/examples/emac/Utilities/b2i2c.exe and /dev/null differ
diff --git a/boot_loader/examples/emac/Utilities/bootpacket.h b/boot_loader/examples/emac/Utilities/bootpacket.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef bootpacket
-#define bootpacket
-
-typedef short int INT16;
-typedef int INT32;
-typedef unsigned short int UINT16;
-typedef unsigned int UINT32;
-
-#define DST_MAC_H 0x0008
-#define DST_MAC_M 0x7433
-#define DST_MAC_L 0x2630
-
-#define SRC_MAC_H 0x000D
-#define SRC_MAC_M 0x5676
-#define SRC_MAC_L 0x2F1A
-
-#define SRC_IP_ADDR_H 0x9EDA
-#define SRC_IP_ADDR_L 0x674E
-#define DST_IP_ADDR_H 0x9EDA
-#define DST_IP_ADDR_L 0x6723
-
-#define UDP_SRC_PORT 0x0
-#define UDP_SRC_PORT_BTPKT 0xBEEF /* Bill's bt-pkt.exe use this value */
-#define UDP_DST_PORT 0x9
-
-#define ETHER_TYPE_IP 0x800
-#define IP_TYPE_UDP 0x11
-
-#define MAGICNO 0x544B
-
-/* Actual packets has 14 +20 + 8 + 244 = 42 + 244 = 286 bytes */
-
-#define MAC_HEADER_LEN 14
-#define IP_HEADER_LEN 20
-#define UDP_HEADER_LEN 8
-#define BOOTTBL_HEADER_LEN 4
-#define TOTAL_HEADER_LEN 46 /* 14 + 20 + 8 + 4 = 46 bytes */
-
-#define MAX_PAYLOAD_LEN 244
-//#define MAX_PAYLOAD_LEN 1176
-#define MAX_BOOTTBL_LEN (MAX_PAYLOAD_LEN - BOOTTBL_HEADER_LEN) /* 240 bytes */
-
-#define SYMBOL 0xEA00
-#define BGN_BYTE_LEN 0x04 /* ex: 0x0000, 0x00A2 */
-#define END_BYTE_LEN 0x06 /* ex: EA00, 0000, 0000 */
-
-
-struct BootPacket {
- INT16 dstMAC_H; /* MAC */
- INT16 dstMAC_M;
- INT16 dstMAC_L;
- INT16 srcMAC_H;
- INT16 srcMAC_M;
- INT16 srcMAC_L;
- INT16 EtherType;
- INT16 VerTOS; /* IP */
- UINT16 IPlength;
- INT16 ID;
- INT16 FlagsFrag;
- INT16 TTLProtocol;
- UINT16 IPchecksum;
- INT16 srcIPAddr_H;
- INT16 srcIPAddr_L;
- INT16 dstIPAddr_H;
- INT16 dstIPAddr_L;
- INT16 srcPort; /* UDP */
- INT16 dstPort;
- UINT16 UDPlength;
- UINT16 UDPchecksum;
- INT16 MagicNo; /* Payload */
- INT16 SeqNo;
- INT16 BootTable[MAX_BOOTTBL_LEN/2];
-};
-
-
-
-#endif
\ No newline at end of file
diff --git a/boot_loader/examples/emac/Utilities/build-msvc.bat b/boot_loader/examples/emac/Utilities/build-msvc.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-;local
-set MSVCROOT=c:\progtool\msvc60\
-set PATH=%MSVCROOT%\vc98\bin;%MSVCROOT%\common\msdev98\bin;%PATH%
-set INCLUDE=%MSVCROOT%\vc98\include
-set LIB=%MSVCROOT%\vc98\lib
-
-cl b2ccs.c
-cl b2i2c.c
-cl bconvert64x.c
-cl bootpacket.c
-cl mergebtbl.c
-cl myparser.c
diff --git a/boot_loader/examples/emac/Utilities/mergebtbl.c b/boot_loader/examples/emac/Utilities/mergebtbl.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/**************************************************************************************
- * FILE PURPOSE: Merge multiple boot tables into one boot table
- **************************************************************************************
- * FILE NAME: mergebtbl.c
- *
- * Usage: mergebtbl inputfile1 inputfile2 ... outputfile
- * Note: may not support single line boot table(hardly possible)
- *
- **************************************************************************************/
-#include <stdio.h>
-#include <string.h>
-
-
-int asciiByte (unsigned char c)
-{
- if ((c >= '0') && (c <= '9'))
- return (1);
-
- if ((c >= 'A') && (c <= 'F'))
- return (1);
-
- return (0);
-}
-
-
-int main (int argc, char *argv[])
-{
- FILE *strin;
- FILE *strout;
- int i,j,k;
- int line;
- int start;
-
- char iline[132];
- char iline2nd[132];
-
- /* Verify the number of args */
- if (argc < 3) {
- printf ("usage: %s inpfile[1] ... infile[n] outfile\n", argv[0]);
- return (-1);
- }
-
- strout = fopen (argv[argc-1], "w");
- if (strout == NULL) {
- printf ("could not open file %s to write\n",argv[argc-1]);
- return (-1);
- }
-
- fputs("first line\n",strout);
- fputs("second line\n",strout);
-
- for(i=1; i<argc-1;i++) {
-
- strin = fopen (argv[i], "r");
- if (strin == NULL) {
- printf ("could not open input file %s\n", argv[i]);
- return (-1);
- }
-
- line = 0;
-
- /* skip the next two lines */
- fgets (iline, 132, strin);
- fgets (iline, 132, strin);
-
- if(fgets(iline2nd, 132, strin)==NULL) {
- printf("error in boot table\n");
- }
-
- while(1) {
- fgets(iline, 132, strin);
- if(!asciiByte(iline[0])) break;
- line++;
-
- if(i!=1 && line==1) { /* if not the first file, get rid of entry point */
- for(j=12; j<132; j++) {
- if(iline2nd[j]=='\0') break;
- fputc(iline2nd[j],strout);
- }
- } else {
- fputs(iline2nd,strout);
- }
- strcpy(iline2nd,iline);
- } /* while */
-
- if(i!=argc-2) { /* If not the last file, get rid of ending 00 00 00 00 */
- for(j=0,start=0;j<132;j+=2){
- if((iline2nd[j]=='0')&&(iline2nd[j+1]=='0')) {
- if(start) k++;
- else if((j-j/4*4)==0) {
- start = 1; /* not count from any 00 */
- k=1;
- }
- }
- else {
- start = 0;
- k=0;
- }
-
- if(k==4) { // when 00 00 00 00 reached
- if(asciiByte(iline2nd[j+3])) { //if the next char is still ASCII
- start = 0;
- } else break; /* Ending 00 00 00 00 reach */
- }
- j++; /* skip the space */
- }
-
- if((k==4) && (j>10)) {
- for(k=0;k<j-10;k++){
- fputc(iline2nd[k],strout);
- }
- fputc('\n',strout);
- }
- } else {
- fputs(iline2nd,strout);
- }
-
- fclose(strin);
- } /* for */
-
- fputc(0x04,strout); /* any non-ASCII character */
-
- fclose(strout);
-
- return (0);
-}
-
diff --git a/boot_loader/examples/emac/Utilities/mergebtbl.exe b/boot_loader/examples/emac/Utilities/mergebtbl.exe
deleted file mode 100644 (file)
index 8fbc185..0000000
Binary files a/boot_loader/examples/emac/Utilities/mergebtbl.exe and /dev/null differ
index 8fbc185..0000000
Binary files a/boot_loader/examples/emac/Utilities/mergebtbl.exe and /dev/null differ
diff --git a/boot_loader/examples/emac/Utilities/myparser.c b/boot_loader/examples/emac/Utilities/myparser.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/**************************************************************************************
- * FILE PURPOSE: Merge I2C boot parameter and boot table into one final .ccs file
- **************************************************************************************
- * FILE NAME: myparser.c
- *
- * Usage: myparser input.ccs input.txt output.ccs
- *
- * Note: this code can be improved to support read boot table not from offset 0x20 but anywhere
- *
- **************************************************************************************/
-#include <stdio.h>
-#include <string.h>
-
-
-/***************************************************************************************
- * FUNCTION PURPOSE: The main program
- ***************************************************************************************
- * DESCRIPTION: Performs the conversion from ccs format to qt format
- ***************************************************************************************/
-int main (int argc, char *argv[])
-{
- FILE *strin1;
- FILE *strin2;
- FILE *strout;
-
- int a,b,c,d,n1,n;
- int i, table;
- int num_tables;
- int table_size;
- int rem_lines;
- long int temp;
-
- char iline[132];
- char iline2[132];
-
- /* Verify the number of args */
- if (argc != 4) {
- printf ("usage: %s input.ccs input.txt output.ccs\n", argv[0]);
- return (-1);
- }
-
- /* Open all the files */
- strin1 = fopen (argv[1], "r");
- if (strin1 == NULL) {
- printf ("could not open input file %s\n", argv[1]);
- return (-1);
- }
-
- strin2 = fopen (argv[2], "r");
- if (strin2 == NULL) {
- printf ("could not open input file %s\n", argv[2]);
- return (-1);
- }
-
- strout = fopen (argv[3], "w");
- if (strout == NULL) {
- printf ("could not open file %s to write\n",argv[3]);
- return (-1);
- }
-
- /* Read the header */
- fgets (iline, 132, strin1);
- sscanf (iline, "%x %x %x %x %x", &a, &b, &c, &d, &n1);
-
- /* read the first config line - get number of tables in the file */
- fgets(iline,132,strin2);
- sscanf (iline, "%x", &num_tables);
-
- if (num_tables == 0)
- {
- printf("Error in I2C configure file, num tables = 0.\n");
- return(-1);
- }
- printf("Reading %d tables from I2C configure file\n", num_tables);
-
- n = n1 + (32 * num_tables) + 2;
-
- /* Write the CCS header */
- fprintf (strout, "1651 1 10890000 1 %x\n", n);
- fprintf (strout, "0x%08x\n",n*4-8);
- fprintf (strout, "0x%08x\n",0);
-
-
- /* Prime the loop: read the table size from the first line */
- if (fgets(iline,132,strin2)==NULL)
- {
- fclose(strin1);
- fclose(strin2);
- fclose(strout);
- printf("Error in I2C configure file\n");
- return(-1);
- }
-
- for (table = 0; table < num_tables; table++)
- {
- strncpy(iline2, iline, 6); //get the first 16 bits (0xffff)
- iline2[6] = 0; //make sure it's null terminated
- sscanf (iline2, "%x", &table_size);
- fprintf(strout, "%s", iline);
-
- printf(" Table %d size %d\n", table+1, table_size);
-
- /* There must be table_size / 4 lines in the file. */
- for (i = 1; i < (table_size / 4); i++)
- {
- if (fgets(iline,132,strin2)==NULL)
- {
- fclose(strin1);
- fclose(strin2);
- fclose(strout);
- printf("Error in I2C configure file\n");
- return(-1);
- }
-
- fprintf (strout, "%s",iline);
- }
-
- rem_lines = (128 - table_size) / 4;
-
- /* Read remaining lines, or encounter the next header early. */
- for (i = 0; i < rem_lines; i++)
- {
- if (fgets(iline,132,strin2)==NULL) break;
-
- strncpy(iline2, iline, 10); //get just the hex number
- iline2[10] = 0; //make sure it's null terminated
- sscanf (iline2, "%x", &temp);
- if (temp != 0) break;
- fprintf (strout, "%s",iline);
- }
-
- if (i < rem_lines) //encountered next header early, add remaining lines
- {
- rem_lines -= i;
-
- for (i = 0; i < rem_lines; i++)
- fprintf (strout, "0x%08x\n",0);
- }
- else if (table < (num_tables - 1))
- {
- fgets(iline,132,strin2); //read the next header
- }
- }
-
- fclose(strin2);
-
- for (i=0; i < n1; i++)
- {
- fgets(iline,132,strin1);
- fprintf (strout, "%s",iline);
- }
-
- fclose(strin1);
- fclose(strout);
-
- return (0);
-}
diff --git a/boot_loader/examples/emac/Utilities/myparser.exe b/boot_loader/examples/emac/Utilities/myparser.exe
deleted file mode 100644 (file)
index 3c1839c..0000000
Binary files a/boot_loader/examples/emac/Utilities/myparser.exe and /dev/null differ
index 3c1839c..0000000
Binary files a/boot_loader/examples/emac/Utilities/myparser.exe and /dev/null differ
diff --git a/boot_loader/examples/emac/simple/simple.btbl b/boot_loader/examples/emac/simple/simple.btbl
+++ /dev/null
@@ -1,10 +0,0 @@
-\ 2
-$A0400,
-00 81 00 00 00 00 00 40 00 81 00 00 00 99 A2 28 00 88 91 68 01 01 00 A8
-01 00 40 E8 01 08 02 26 01 81 08 28 01 80 40 E8 01 8C 36 26 02 0C 02 26
-00 01 A1 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-00 00 00 00
-00 00 00 04 00 81 01 00 12 34 AB CD
-00 00 00 01 00 81 02 01 00 00 00 12
-00 00 00 02 00 81 02 10 00 00 34 12 00 00 00 00
-\ 3
\ No newline at end of file
diff --git a/boot_loader/examples/emac/simple/simple.le.btbl b/boot_loader/examples/emac/simple/simple.le.btbl
+++ /dev/null
@@ -1,8 +0,0 @@
-\ 2
-$A000000
-00 81 00 00 00 00 00 40 00 81 00 00 00 99 A2 28 00 88 91 68 01 01 00 A8
-01 00 40 E8 01 08 02 26 01 81 08 28 01 80 40 E8 01 8C 36 26 02 0C 02 26
-00 01 A1 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 04 00 81 01 00 12 34 AB CD 00 00 00 01 00 81 02 01
-12 00 00 00 00 00 00 02 00 81 02 10 12 34 00 00 00 00 00 00
-\ 3
\ No newline at end of file
diff --git a/boot_loader/examples/emac/simple/simple.map b/boot_loader/examples/emac/simple/simple.map
+++ /dev/null
@@ -1,95 +0,0 @@
-******************************************************************************
- TMS320C6x Linker PC v7.2.0
-******************************************************************************
->> Linked Mon May 02 11:08:25 2011
-
-OUTPUT FILE NAME: <simple.out>
-ENTRY POINT SYMBOL: "_c_int00" address: 00810000
-
-
-MEMORY CONFIGURATION
-
- name origin length used unused attr fill
----------------------- -------- --------- -------- -------- ---- --------
- TEXT 00810000 00000040 00000040 00000000 RWIX
- DATA 00810100 00000004 00000004 00000000 RWIX
- BYTE1 00810201 00000001 00000001 00000000 RWIX
- BYTE2 00810210 00000002 00000002 00000000 RWIX
-
-
-SECTION ALLOCATION MAP
-
- output attributes/
-section page origin length input sections
--------- ---- ---------- ---------- ----------------
-.text 0 00810000 00000040
- 00810000 00000040 simple.obj (.text)
-
-.data 0 00810100 00000004
- 00810100 00000004 simple.obj (.data)
-
-.byte1 0 00810201 00000001
- 00810201 00000001 simple.obj (.byte1)
-
-.byte2 0 00810210 00000002
- 00810210 00000002 simple.obj (.byte2)
-
-
-GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
-
-address name
--------- ----
-00000000 $bss
-00810100 .data
-00810000 .text
-ffffffff ___TI_pprof_out_hndl
-ffffffff ___TI_prof_data_size
-ffffffff ___TI_prof_data_start
-ffffffff ___binit__
-ffffffff ___c_args__
-ffffffff ___cinit__
-00810100 ___data__
-00810104 ___edata__
-00810040 ___etext__
-ffffffff ___pinit__
-00810000 ___text__
-00810000 _c_int00
-ffffffff binit
-00810201 byte1
-00810210 byte2
-ffffffff cinit
-00810104 edata
-00810040 etext
-ffffffff pinit
-00810100 someData
-
-
-GLOBAL SYMBOLS: SORTED BY Symbol Address
-
-address name
--------- ----
-00000000 $bss
-00810000 .text
-00810000 ___text__
-00810000 _c_int00
-00810040 ___etext__
-00810040 etext
-00810100 .data
-00810100 ___data__
-00810100 someData
-00810104 ___edata__
-00810104 edata
-00810201 byte1
-00810210 byte2
-ffffffff ___TI_pprof_out_hndl
-ffffffff ___TI_prof_data_size
-ffffffff ___TI_prof_data_start
-ffffffff ___binit__
-ffffffff ___c_args__
-ffffffff ___cinit__
-ffffffff ___pinit__
-ffffffff binit
-ffffffff cinit
-ffffffff pinit
-
-[23 symbols]
diff --git a/boot_loader/examples/emac/simple/simple.obj b/boot_loader/examples/emac/simple/simple.obj
deleted file mode 100644 (file)
index 59de594..0000000
Binary files a/boot_loader/examples/emac/simple/simple.obj and /dev/null differ
index 59de594..0000000
Binary files a/boot_loader/examples/emac/simple/simple.obj and /dev/null differ
diff --git a/boot_loader/examples/emac/simple/simple.out b/boot_loader/examples/emac/simple/simple.out
deleted file mode 100644 (file)
index 54460bc..0000000
Binary files a/boot_loader/examples/emac/simple/simple.out and /dev/null differ
index 54460bc..0000000
Binary files a/boot_loader/examples/emac/simple/simple.out and /dev/null differ
diff --git a/boot_loader/examples/emac/simple/simple.s b/boot_loader/examples/emac/simple/simple.s
+++ /dev/null
@@ -1,64 +0,0 @@
-;****************************************************************************
-;* FILE PURPOSE: Code a simple endian independent example
-;****************************************************************************
-;* FILE NAME: Simple.s
-;*
-;* DESCRIPTION: This program is part of the Himalaya I2C boot test plan.
-;* It is a simple program that defines two initialized
-;* sections, text and data, and performs a simple
-;* execution with a self check on the results in register a0.
-;*
-;* The code is also designed to be relocatable, so it will
-;* function in the himsim program running on the DM642.
-;*
-;*****************************************************************************
-
-;*****************************************************************************
-;* Initialized data
-;*****************************************************************************
- .data
- .def someData
-someData .word 01234ABCDh
-
- .def byte1
- .sect ".byte1"
-byte1: .byte 0x12
-
- .def byte2
- .sect ".byte2"
-byte2: .byte 0x12, 0x34
-
-;*****************************************************************************
-;* code
-;*****************************************************************************
- .text
- .def _c_int00
-
-myConst .equ 011223344h
-
-_c_int00:
-
- MVKL.S1 myConst, A1
- MVKH.S1 myConst, A1
-
- MVKL.S1 byte1, A2
- MVKH.S1 byte1, A2
- LDB.D1 *A2, B2
-
- MVKL.S1 byte2, A3
- MVKH.S1 byte2, A3
- LDB.D1 *A3++, B3
- LDB.D1 *A3, B4
-
-
-etrap:
-
- BNOP.S1 etrap, 5
-
-
-
-
-
-
-
-
diff --git a/boot_loader/examples/emac/Ethernet_boot/pcsendpkt.c b/boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.c
similarity index 69%
rename from boot_loader/examples/emac/Ethernet_boot/pcsendpkt.c
rename to boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.c
index 587ca2f0ac1fa45ed36f4ca5c89ba3fac1909bd2..c3c07fd13667b9e3e8f68e744612d2baacf08dfb 100644 (file)
rename from boot_loader/examples/emac/Ethernet_boot/pcsendpkt.c
rename to boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.c
index 587ca2f0ac1fa45ed36f4ca5c89ba3fac1909bd2..c3c07fd13667b9e3e8f68e744612d2baacf08dfb 100644 (file)
+/******************************************************************************
+ * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *****************************************************************************/
#include <windows.h>
#include <stdio.h>
#include <time.h>
/* get length in bytes */
if(fgets(iline, 131, strin)==NULL) break;
length = toNum(iline[2])<<12 | toNum(iline[3])<<8 | toNum(iline[4])<<4 | toNum(iline[5]);
- if(length == 0) break;
+ if(length == 0) break;
else if(length < UDP_LOW || length > UDP_HIGH) {
printf("Invalid length = %d\n",length);
goto end;
/* packet number */
packetno++;
printf("Packet %d sent\n",packetno);
-
+
/* add delay between packets */
for(i=0; i<DELAY; i++) {
tmp4 = tmp3;
diff --git a/boot_loader/examples/emac/Ethernet_boot/pcsendpkt.exe b/boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.exe
similarity index 100%
rename from boot_loader/examples/emac/Ethernet_boot/pcsendpkt.exe
rename to boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.exe
rename from boot_loader/examples/emac/Ethernet_boot/pcsendpkt.exe
rename to boot_loader/examples/ethernet/Ethernet_boot/pcsendpkt.exe
diff --git a/boot_loader/examples/emac/Ethernet_boot/simple.eth b/boot_loader/examples/ethernet/Ethernet_boot/simple.eth
similarity index 100%
rename from boot_loader/examples/emac/Ethernet_boot/simple.eth
rename to boot_loader/examples/ethernet/Ethernet_boot/simple.eth
rename from boot_loader/examples/emac/Ethernet_boot/simple.eth
rename to boot_loader/examples/ethernet/Ethernet_boot/simple.eth
diff --git a/boot_loader/examples/emac/Utilities/bconvert64x.c b/boot_loader/examples/ethernet/Utilities/bconvert64x.c
similarity index 89%
rename from boot_loader/examples/emac/Utilities/bconvert64x.c
rename to boot_loader/examples/ethernet/Utilities/bconvert64x.c
index 98b0dfd8df19bcba86c74a62ed892c76ac15b27a..c6b1b27b58bd9a92d0527121c3275b15987174cd 100644 (file)
rename from boot_loader/examples/emac/Utilities/bconvert64x.c
rename to boot_loader/examples/ethernet/Utilities/bconvert64x.c
index 98b0dfd8df19bcba86c74a62ed892c76ac15b27a..c6b1b27b58bd9a92d0527121c3275b15987174cd 100644 (file)
+/******************************************************************************
+ * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *****************************************************************************/
+
/************************************************************************************
* FILE PURPOSE: Convert a hex6x boot table file into the format required
- * by the c6x chip boot loader.
+ * by the c6x chip boot loader.
************************************************************************************
* FILE NAME: bconvert.c
*
* | Data byte | Data byte | Data byte | Data byte | /
* +-------------+-------------+-------------+--------------+ /
* | Data byte | Data byte | Data byte | Data byte | /
- * +-------------+-------------+-------------+--------------+
- * | 32 bit zero byte count (end of boot table) |
+ * +-------------+-------------+-------------+--------------+
+ * | 32 bit zero byte count (end of boot table) |
* \--------------------------------------------------------/
*
*
ERR_VALUE16_SIZE_ERR,
ERR_DATA32_SIZE_ERR,
ERR_REG32_PARSE_ERROR,
- ERR_DATA32_REMAIN_ERR
+ ERR_DATA32_REMAIN_ERR
};
enum {
/* Make sure endian is known */
- if (!espec)
+ if (!espec)
return (ERR_PARSE_NO_ENDIAN);
/* Open input file if not stdin */
if (*fout == NULL)
return (ERR_PARSE_OUTPUT_OPEN_FAIL);
}
-
+
return (0);
} /* parseit */
@@ -378,7 +411,7 @@ unsigned value32bitAdd (int endian, unsigned char *data, unsigned n, unsigned *p
v = (unsigned)data[w+0] << 24 |
(unsigned)data[w+1] << 16 |
(unsigned)data[w+2] << 8 |
- (unsigned)data[w+3] << 0 ;
+ (unsigned)data[w+3] << 0 ;
*errflag = 0;
@@ -411,9 +444,9 @@ unsigned value32bit (int endian, unsigned char *data, unsigned n, unsigned *p, i
/*********************************************************************************
- * FUNCTION PURPOSE: Convert up to four bytes to big endian
+ * FUNCTION PURPOSE: Convert up to four bytes to big endian
*********************************************************************************
- * DESCRIPTION: Data bytes are converted.
+ * DESCRIPTION: Data bytes are converted.
*********************************************************************************/
#define SWAP(x,y,z) (z)=(x);(x)=(y);(y)=(z)
void data32bit (int endian, unsigned char *data, unsigned n, unsigned *p, unsigned m, int *errflag)
fclose (fout);
} /* writeBFile */
-
+
/**************************************************************************************
- * FUNCTION PURPOSE: Main
+ * FUNCTION PURPOSE: Main
**************************************************************************************
* DESCRIPTION: Provides the top level program flow.
**************************************************************************************/
unsigned n32; /* Number of bytes that form complete 32 bit values */
unsigned r32; /* Number of bytes remaining (0-3) */
- int endian; /* Endian */
+ int endian; /* Endian */
int errflag; /* error indicator */
int i, j; /* loop var */
int origRegs; /* original reg count */
/* The sections */
do {
-
- /* Get the section byte count */
+
+ /* Get the section byte count */
v = value32bit (endian, data, n, &p, &errflag);
if (errflag) {
showErr (errflag);
/* Return resources */
free (data);
- return (0);
+ return (0);
}
-
-
+
+
diff --git a/boot_loader/examples/emac/Utilities/bconvert64x.exe b/boot_loader/examples/ethernet/Utilities/bconvert64x.exe
similarity index 100%
rename from boot_loader/examples/emac/Utilities/bconvert64x.exe
rename to boot_loader/examples/ethernet/Utilities/bconvert64x.exe
rename from boot_loader/examples/emac/Utilities/bconvert64x.exe
rename to boot_loader/examples/ethernet/Utilities/bconvert64x.exe
diff --git a/boot_loader/examples/emac/Utilities/bootpacket.c b/boot_loader/examples/ethernet/Utilities/bootpacket.c
similarity index 84%
rename from boot_loader/examples/emac/Utilities/bootpacket.c
rename to boot_loader/examples/ethernet/Utilities/bootpacket.c
index e11d4f578671878907010e8ccf5edc608fda9bff..6beb46de354603d8957b00905a8581cc31f6f2ed 100644 (file)
rename from boot_loader/examples/emac/Utilities/bootpacket.c
rename to boot_loader/examples/ethernet/Utilities/bootpacket.c
index e11d4f578671878907010e8ccf5edc608fda9bff..6beb46de354603d8957b00905a8581cc31f6f2ed 100644 (file)
-/* Convert a boot table to Ethernet boot format */
-/* A simple utility program written by D.Zhou */
+/******************************************************************************
+ * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *****************************************************************************/
+
+/* A simple utility program to convert a boot table to Ethernet boot format */
/* Version: 0.3 */
-/* Last modified on: June 14,2006 */
#include <stdio.h>
else if ((c >= 'a') && (c <= 'f'))
return(c - 'a' + 10);
- else if(c == ':')
+ else if(c == ':')
return(100);
return(200);
y = fgetc (s);
if (y == (unsigned char)EOF)
return (byteCount);
- if (asciiByte(y))
+ if (asciiByte(y))
byteCount++;
}
}
result = (result >> 16) + (result & 0xFFFF); /* add in carry */
result += (result >> 16); /* maybe one more */
return (UINT16)result;
-}
+}
p_data++;
len--;
}
- return ((unsigned short) ~chksum);
+ return ((unsigned short) ~chksum);
}
-/*
+/*
Input file format: boot table in big endian format
- Output file format:
+ Output file format:
1st line: CCS data format
2nd line: 0x0000
3rd line: length of first packet in bytes, length counts not include itself
.......
- first packet
+ first packet
.......
0xEA00
.......
second packet
.......
-
+
0xEA00
0x0000
other packets
.......
- 0xEA00
+ 0xEA00
0X0000
0X0000: end of the file
*/
data.srcMAC_L = (unsigned short)(MACaddr[4]<<8 | MACaddr[5]);
} else { /* use default MAC address */
- data.dstMAC_H = (unsigned short)DST_MAC_H;
+ data.dstMAC_H = (unsigned short)DST_MAC_H;
data.dstMAC_M = (unsigned short)DST_MAC_M;
data.dstMAC_L = (unsigned short)DST_MAC_L;
data.srcMAC_H = (unsigned short)SRC_MAC_H;
fprintf (strout, "0x%04X\n",0x0000);
fprintf (strout, "0x%04X\n",TOTAL_HEADER_LEN+MAX_BOOTTBL_LEN); /* length in bytes */
-
+
data.UDPlength = UDP_HEADER_LEN + BOOTTBL_HEADER_LEN + MAX_BOOTTBL_LEN;
data.IPlength = data.UDPlength + IP_HEADER_LEN;
UDPchecksum = bootmiscOnesComplementAdd(IP_TYPE_UDP, data.UDPlength);
for(j=0; j<counter; j++) { // For first and middle packets
-
+
data.IPchecksum=bootmiscOnesComplementChksum(0,&data.VerTOS,IP_HEADER_LEN/2);
-
+
if(getDataIn(strin, MAX_BOOTTBL_LEN, data.BootTable)!=0) {
fclose(strin);
fclose(strout);
- return;
+ return;
};
data.UDPchecksum=bootmiscOnesComplementChksum(UDPchecksum, &data.srcIPAddr_H,\
data.IPchecksum = 0x0000;
data.UDPchecksum = 0x0000;
- }
+ }
// For the last packet
temp = counter*MAX_BOOTTBL_LEN;
diff --git a/boot_loader/examples/emac/Utilities/bootpacket.exe b/boot_loader/examples/ethernet/Utilities/bootpacket.exe
similarity index 100%
rename from boot_loader/examples/emac/Utilities/bootpacket.exe
rename to boot_loader/examples/ethernet/Utilities/bootpacket.exe
rename from boot_loader/examples/emac/Utilities/bootpacket.exe
rename to boot_loader/examples/ethernet/Utilities/bootpacket.exe
diff --git a/boot_loader/examples/ethernet/Utilities/bootpacket.h b/boot_loader/examples/ethernet/Utilities/bootpacket.h
--- /dev/null
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *****************************************************************************/
+
+#ifndef bootpacket
+#define bootpacket
+
+typedef short int INT16;
+typedef int INT32;
+typedef unsigned short int UINT16;
+typedef unsigned int UINT32;
+
+#define DST_MAC_H 0x0008
+#define DST_MAC_M 0x7433
+#define DST_MAC_L 0x2630
+
+#define SRC_MAC_H 0x000D
+#define SRC_MAC_M 0x5676
+#define SRC_MAC_L 0x2F1A
+
+#define SRC_IP_ADDR_H 0x9EDA
+#define SRC_IP_ADDR_L 0x674E
+#define DST_IP_ADDR_H 0x9EDA
+#define DST_IP_ADDR_L 0x6723
+
+#define UDP_SRC_PORT 0x0
+#define UDP_SRC_PORT_BTPKT 0xBEEF /* Bill's bt-pkt.exe use this value */
+#define UDP_DST_PORT 0x9
+
+#define ETHER_TYPE_IP 0x800
+#define IP_TYPE_UDP 0x11
+
+#define MAGICNO 0x544B
+
+/* Actual packets has 14 +20 + 8 + 244 = 42 + 244 = 286 bytes */
+
+#define MAC_HEADER_LEN 14
+#define IP_HEADER_LEN 20
+#define UDP_HEADER_LEN 8
+#define BOOTTBL_HEADER_LEN 4
+#define TOTAL_HEADER_LEN 46 /* 14 + 20 + 8 + 4 = 46 bytes */
+
+#define MAX_PAYLOAD_LEN 244
+//#define MAX_PAYLOAD_LEN 1176
+#define MAX_BOOTTBL_LEN (MAX_PAYLOAD_LEN - BOOTTBL_HEADER_LEN) /* 240 bytes */
+
+#define SYMBOL 0xEA00
+#define BGN_BYTE_LEN 0x04 /* ex: 0x0000, 0x00A2 */
+#define END_BYTE_LEN 0x06 /* ex: EA00, 0000, 0000 */
+
+
+struct BootPacket {
+ INT16 dstMAC_H; /* MAC */
+ INT16 dstMAC_M;
+ INT16 dstMAC_L;
+ INT16 srcMAC_H;
+ INT16 srcMAC_M;
+ INT16 srcMAC_L;
+ INT16 EtherType;
+ INT16 VerTOS; /* IP */
+ UINT16 IPlength;
+ INT16 ID;
+ INT16 FlagsFrag;
+ INT16 TTLProtocol;
+ UINT16 IPchecksum;
+ INT16 srcIPAddr_H;
+ INT16 srcIPAddr_L;
+ INT16 dstIPAddr_H;
+ INT16 dstIPAddr_L;
+ INT16 srcPort; /* UDP */
+ INT16 dstPort;
+ UINT16 UDPlength;
+ UINT16 UDPchecksum;
+ INT16 MagicNo; /* Payload */
+ INT16 SeqNo;
+ INT16 BootTable[MAX_BOOTTBL_LEN/2];
+};
+
+
+
+#endif
\ No newline at end of file
diff --git a/boot_loader/examples/ethernet/docs/README.txt b/boot_loader/examples/ethernet/docs/README.txt
--- /dev/null
@@ -0,0 +1,62 @@
+ROM Ethernet boot example
+
+A simple example demonstrating ROM Ethernet boot.
+
+
+Directory structure:
+
+docs - directory contains the README.txt
+simple - directory contains the batch/make file to build the simple example
+Utilities - directory contains the utilities to convert the hex6x boot table file
+ to the Ethernet boot format data file:
+
+ bconvert64x.exe - Convert a hex6x boot table file into the format required
+ by the c6x chip boot loader.
+ bootpacket.exe - Convert a boot table to Ethernet boot format
+
+
+Steps to build the example:
+
+1. Run "simple.bat" under "tools\boot_loader\examples\ethernet\simple\". This will build the simple.out and use
+ hex6x.exe (delivered in CG tools package) to convert the .out to a boot table file, and then use the
+ bconvert64x.exe/bootpacket.exe to convert the hex6x boot table file to the Ethernet boot format data file,
+ simple.eth.
+
+
+Steps to send the simple.eth from the Host to the target DSP
+
+1. Boot the target DSP in ROM Ethernet boot mode.
+
+ The DIP switch setting for C6678 EVM is:
+ SW3(pin1, pin2, pin3, pin4): off, on, off, on
+ SW4(pin1, pin2, pin3, pin4): on, on, on, off
+ SW5(pin1, pin2, pin3, pin4): on, on, off, off
+ SW6(pin1, pin2, pin3, pin4): off, on, on, on
+
+ The DIP switch setting for C6670 EVM is:
+ SW3(pin1, pin2, pin3, pin4): off, on, off, on
+ SW4(pin1, pin2, pin3, pin4): on, on, on, off
+ SW5(pin1, pin2, pin3, pin4): on, off, on, off
+ SW6(pin1, pin2, pin3, pin4): off, off, on, on
+
+2. Once the DSP boots up, it transmits BOOTP packet at regular interval which will have the MAC ID of the DSP.
+
+3. Add an ARP entry for the DSP MAC address associating with an IP local to the host. For example if the host PC's
+ IP is 192.168.1.1, then add an ARP entry with the DSP's MAC address associated with IP address 192.168.1.2.
+
+4. Use the pcsendpkt.exe to send the image to the DSP using the associated IP address. For example
+ pcsendpkt.exe simple.eth 192.168.1.2
+
+5. Use CCS to connect the EVM, and check that A1 register is set to 0x11223344, that confirms the simple program
+ is received and booted by the ROM boot loader.
+
+Notes:
+1. In order to compile the pcsendpkt.c file please compile with -lwsock32 option for using windows socket.
+2. Please refer to the C66x DSP Bootloader User's Guide (http://www.ti.com/litv/pdf/sprugy5) for more details.
+3. Please refer to C6678L/C6670L EVM boot mode dip switch settings:
+http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+
+and User's Guide for more details:
+http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide
+
diff --git a/boot_loader/examples/emac/simple/makefile b/boot_loader/examples/ethernet/simple/makefile
similarity index 93%
rename from boot_loader/examples/emac/simple/makefile
rename to boot_loader/examples/ethernet/simple/makefile
index 136d6bd011aeb038b883c554e99b66019d545512..949de974d276159470d4c066e5f0d7897e4a066f 100644 (file)
rename from boot_loader/examples/emac/simple/makefile
rename to boot_loader/examples/ethernet/simple/makefile
index 136d6bd011aeb038b883c554e99b66019d545512..949de974d276159470d4c066e5f0d7897e4a066f 100644 (file)
#*
#* DESCRIPTION: Builds the following:
#*
-#* simple_him.out - little endian himalaya mapped program.
+#* simple.out - little endian mapped program.
#* simple.le.btbl - Simple program in boot table format.
#* simple.eth - Simple Program in ETH format.
#*
diff --git a/boot_loader/examples/ethernet/simple/simple.bat b/boot_loader/examples/ethernet/simple/simple.bat
--- /dev/null
@@ -0,0 +1,4 @@
+set PATH=%PATH%;"C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c6000\bin";
+make simple.eth
+
+
diff --git a/boot_loader/examples/emac/simple/simple.cmd b/boot_loader/examples/ethernet/simple/simple.cmd
similarity index 83%
rename from boot_loader/examples/emac/simple/simple.cmd
rename to boot_loader/examples/ethernet/simple/simple.cmd
index 6b7cf3d040270a38807adc5aaf7c1739fae7867e..458959396572801f93ebb401ceaa7f5c17df94e6 100644 (file)
rename from boot_loader/examples/emac/simple/simple.cmd
rename to boot_loader/examples/ethernet/simple/simple.cmd
index 6b7cf3d040270a38807adc5aaf7c1739fae7867e..458959396572801f93ebb401ceaa7f5c17df94e6 100644 (file)
/***************************************************************************
- * FILE PURPOSE: The Himalaya linker command file for program simple
+ * FILE PURPOSE: The linker command file for program simple
***************************************************************************
* FILE NAME: simple_him.cmd
*
- * DESCRIPTION: Maps the program simple into the Himalaya memory space
+ * DESCRIPTION: Maps the program simple into the memory space
*
***************************************************************************/
diff --git a/boot_loader/examples/emac/simple/simple.rmd b/boot_loader/examples/ethernet/simple/simple.rmd
similarity index 100%
rename from boot_loader/examples/emac/simple/simple.rmd
rename to boot_loader/examples/ethernet/simple/simple.rmd
rename from boot_loader/examples/emac/simple/simple.rmd
rename to boot_loader/examples/ethernet/simple/simple.rmd
diff --git a/boot_loader/examples/ethernet/simple/simple.s b/boot_loader/examples/ethernet/simple/simple.s
--- /dev/null
@@ -0,0 +1,96 @@
+;/******************************************************************************
+; * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
+; *
+; * Redistribution and use in source and binary forms, with or without
+; * modification, are permitted provided that the following conditions
+; * are met:
+; *
+; * Redistributions of source code must retain the above copyright
+; * notice, this list of conditions and the following disclaimer.
+; *
+; * Redistributions in binary form must reproduce the above copyright
+; * notice, this list of conditions and the following disclaimer in the
+; * documentation and/or other materials provided with the
+; * distribution.
+; *
+; * Neither the name of Texas Instruments Incorporated nor the names of
+; * its contributors may be used to endorse or promote products derived
+; * from this software without specific prior written permission.
+; *
+; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+; * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+; * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+; * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+; * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+; * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+; * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+; * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+; * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+; * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+; *
+; *****************************************************************************/
+
+;****************************************************************************
+;* FILE PURPOSE: A simple endian independent example
+;****************************************************************************
+;* FILE NAME: Simple.s
+;*
+;* DESCRIPTION: A simple program that defines two initialized
+;* sections, text and data, and performs the following simple
+;* executions:
+;* 1. store a constant (011223344h) to register A1
+;* 2. store the data in byte1 section (0x12) to registerB2.
+;* 3. store the data in byte21 section (0x12, 034) to register B3, B4.
+;*
+;*****************************************************************************
+
+;*****************************************************************************
+;* Initialized data
+;*****************************************************************************
+ .data
+ .def someData
+someData .word 01234ABCDh
+
+ .def byte1
+ .sect ".byte1"
+byte1: .byte 0x12
+
+ .def byte2
+ .sect ".byte2"
+byte2: .byte 0x12, 0x34
+
+;*****************************************************************************
+;* code
+;*****************************************************************************
+ .text
+ .def _c_int00
+
+myConst .equ 011223344h
+
+_c_int00:
+
+ MVKL.S1 myConst, A1
+ MVKH.S1 myConst, A1
+
+ MVKL.S1 byte1, A2
+ MVKH.S1 byte1, A2
+ LDB.D1 *A2, B2
+
+ MVKL.S1 byte2, A3
+ MVKH.S1 byte2, A3
+ LDB.D1 *A3++, B3
+ LDB.D1 *A3, B4
+
+
+etrap:
+
+ BNOP.S1 etrap, 5
+
+
+
+
+
+
+
+
diff --git a/boot_loader/examples/i2c/nand/docs/README.txt b/boot_loader/examples/i2c/nand/docs/README.txt
index 6930c195485d909cdd0ea35ec3fadea4ef837a27..fe9eab9bcb21d64b1cbf924860c92df038b2d0a6 100644 (file)
Steps to program i2cnandboot to NAND:
-1. Be sure IBL is programmed to I2C EEPROM bus address 81 (0x51), if IBL is not programmed, refer to
+1. Be sure IBL is programmed to I2C EEPROM bus address 0x51, if IBL is not programmed, refer to
tools\boot_loader\ibl\doc\README.txt on how to program the IBL to EEPROM.
2. By default, IBL will boot a BBLOB image (Linux kernel) from NAND, to run this example, we need to change the
NAND boot image format to ELF:
- a. In setConfig_c66xx_main() of tools\boot_loader\ibl\src\util\i2cConfig\i2cConfig.gel,
+ a. In setConfig_c66xx_main() of tools\boot_loader\ibl\src\make\bin\i2cConfig.gel,
replace
ibl.bootModes[1].u.nandBoot.bootFormat = ibl_BOOT_FORMAT_BBLOB;
with
the app.bin to NAND flash.
4. Once the programming is completed successfully, set the boot dip switches to I2C master mode,
- bus address 81 (0x51) and boot parameter index to be 2.
+ bus address 0x51 and boot parameter index to be 2.
5. After POR, IBL will boot the hello world image from NAND.
-Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
+Please refer to C6678L/C6670L EVM boot mode dip switch settings:
+http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+
+and User's Guide for more details:
+http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide
diff --git a/boot_loader/examples/i2c/nor/docs/README.txt b/boot_loader/examples/i2c/nor/docs/README.txt
index dd4d846f55b6b8cfbb7c49bcbd33248dc172cc8c..b6119ed50aa8082b16843a50ab44339b41831847 100644 (file)
Steps to program i2cnorboot to NOR:
-1. Be sure IBL and boot configuration table are programmed to I2C EEPROM bus address 81 (0x51), if IBL and/or
+1. Be sure IBL and boot configuration table are programmed to I2C EEPROM bus address 0x51, if IBL and/or
boot configuration table are not programmed, refer to tools\boot_loader\ibl\doc\README.txt on how to program
the IBL and boot configuration table to EEPROM.
the app.bin to NOR flash.
3. Once the programming is completed successfully, set the boot dip switches to I2C master mode,
- bus address 81 (0x51) and boot parameter index to be 0.
+ bus address 0x51 and boot parameter index to be 0.
4. After POR, IBL will boot the hello world image from NOR.
-Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
+Please refer to C6678L/C6670L EVM boot mode dip switch settings:
+http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+
+and User's Guide for more details:
+http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide
+
+
diff --git a/boot_loader/examples/i2c/emac/docs/README.txt b/boot_loader/examples/i2c/tftp/docs/README.txt
similarity index 53%
rename from boot_loader/examples/i2c/emac/docs/README.txt
rename to boot_loader/examples/i2c/tftp/docs/README.txt
index dda194dd4c201cd470126835b0811cb3cfaecce6..d2799aa94abe8b88a71a97b67f8304b1f5ba00d3 100644 (file)
rename from boot_loader/examples/i2c/emac/docs/README.txt
rename to boot_loader/examples/i2c/tftp/docs/README.txt
index dda194dd4c201cd470126835b0811cb3cfaecce6..d2799aa94abe8b88a71a97b67f8304b1f5ba00d3 100644 (file)
-EMAC boot over I2C example
+TFTP boot over I2C example
-A simple Hello World example demonstrating EMAC boot over I2C.
+A simple Hello World example demonstrating TFTP boot over I2C.
Steps to build the example:
-1. Import the i2cemacboot CCS project from tools\boot_loader\examples\i2c\emac\evmc66xxl directory. (in CCSv5,
+1. Import the i2ctftpboot CCS project from tools\boot_loader\examples\i2c\tftp\evmc66xxl directory. (in CCSv5,
Project->Import Existing CCS/CCE Eclipse Projects)
-2. Clean the i2cemacboot project and re-build the project, after build is completed, i2cemacboot_evm66xxl.out and
- i2cemacboot_evm66xxl.map will be generated under tools\boot_loader\examples\i2c\emac\evmc66xxl\bin directory.
+2. Clean the i2ctftpboot project and re-build the project, after build is completed, i2ctftpboot_evm66xxl.out and
+ i2ctftpboot_evm66xxl.map will be generated under tools\boot_loader\examples\i2c\tftp\evmc66xxl\bin directory.
-Steps to run i2cemacboot in CCSv5:
+Steps to run i2ctftpboot in CCSv5:
1. Be sure to set the boot mode dip switch to no boot/EMIF16 boot mode on the EVM.
-2. Load the program tools\boot_loader\examples\i2c\emac\evmc66xxl\bin\i2cemacboot_evm66xxl.out to CCS.
+2. Load the program tools\boot_loader\examples\i2c\tftp\evmc66xxl\bin\i2ctftpboot_evm66xxl.out to CCS.
3. Connect the 3-pin RS-232 cable from the EVM to the serial port of the PC, and start Hyper Terminal.
4. Create a new connection with the Baud rate set to 115200 bps, Data bits 8, Parity none, Stop bits 1 and
Flow control none. Be sure the COM port # is set correctly.
-5. Run the program in CCS, i2cemacboot will send the hello world booting info to both the CCS console and the
+5. Run the program in CCS, i2ctftpboot will send the hello world booting info to both the CCS console and the
Hyper Terminal.
-Steps to boot i2cemacboot from EMAC:
+Steps to boot i2ctftpboot from TFTP:
1. Be sure IBL is programmed to I2C EEPROM bus address 81 (0x51), if IBL is not programmed, refer to
tools\boot_loader\ibl\doc\README.txt on how to program the IBL to EEPROM.
-2. By default, IBL will boot a BBLOB image from EMAC, to run this example, we need to change the
- EMAC boot image format to ELF:
- a. In setConfig_c66xx_main() of tools\boot_loader\ibl\src\util\i2cConfig\i2cConfig.gel,
+2. By default, IBL will boot a BBLOB image from TFTP, to run this example, we need to change the
+ TFTP boot image format to ELF:
+ a. In setConfig_c66xx_main() of tools\boot_loader\ibl\src\make\bin\i2cConfig.gel,
replace
ibl.bootModes[2].u.ethBoot.bootFormat = ibl_BOOT_FORMAT_BBLOB;
with
the boot configuration table to EEPROM.
3. Start a TFTP server (you can download a free, open source application from http://tftpd32.jounin.net) and copy
- tools\boot_loader\examples\i2c\emac\evmc66xxl\bin\i2cemacboot_evm66xxl.out to the TFTP base directory, rename
- i2cemacboot_evm66xxl.out to app.out.
+ tools\boot_loader\examples\i2c\tftp\evmc66xxl\bin\i2ctftpboot_evm66xxl.out to the TFTP base directory, rename
+ i2ctftpboot_evm66xxl.out to app.out.
4. Set the IP address of the PC that is running the TFTP server to 192.168.2.101, since by default IBL will set the EVM
IP address to 192.168.2.100 and the TFTP server IP address to 192.168.2.101.
-5. Set the boot dip switches to I2C master mode, bus address 81 (0x51) and boot parameter index to be 4.
+5. Set the boot dip switches to I2C master mode, bus address 0x51 and boot parameter index to be 4.
6. Be sure the EVM and the PC are connected in the same subnet of a local network, after POR, IBL will download the
boot image from TFTP server and boot from it.
-Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
+Please refer to C6678L/C6670L EVM boot mode dip switch settings:
+http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+
+and User's Guide for more details:
+http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide
diff --git a/boot_loader/examples/i2c/emac/evmc6670l/.ccsproject b/boot_loader/examples/i2c/tftp/evmc6670l/.ccsproject
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6670l/.ccsproject
rename to boot_loader/examples/i2c/tftp/evmc6670l/.ccsproject
rename from boot_loader/examples/i2c/emac/evmc6670l/.ccsproject
rename to boot_loader/examples/i2c/tftp/evmc6670l/.ccsproject
diff --git a/boot_loader/examples/i2c/emac/evmc6670l/.cproject b/boot_loader/examples/i2c/tftp/evmc6670l/.cproject
similarity index 95%
rename from boot_loader/examples/i2c/emac/evmc6670l/.cproject
rename to boot_loader/examples/i2c/tftp/evmc6670l/.cproject
index b056636e0a868c5310f7b145f58d91869877acab..03a9e17b0d0ef7d787ac78a46ec6477fce0bc387 100644 (file)
rename from boot_loader/examples/i2c/emac/evmc6670l/.cproject
rename to boot_loader/examples/i2c/tftp/evmc6670l/.cproject
index b056636e0a868c5310f7b145f58d91869877acab..03a9e17b0d0ef7d787ac78a46ec6477fce0bc387 100644 (file)
<?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/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="out" artifactName="../bin/i2cemacboot_evm6670l" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
+ <configuration artifactExtension="out" artifactName="../bin/i2ctftpboot_evm6670l" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
<folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain.2097842143" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.854128311">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.732314103" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug.30003368" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug"/>
- <builder buildPath="${workspace_loc:/i2cemacboot/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1571910857" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug"/>
+ <builder buildPath="${workspace_loc:/i2ctftpboot/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1571910857" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug.1787566966" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING.1206666269" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
<inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS.2124959934" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.854128311" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug">
- <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE.572435525" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE" value=""../bin/i2cemacboot_evm6670l.out"" valueType="string"/>
- <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.405326097" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE" value=""../bin/i2cemacboot_evm6670l.map"" valueType="string"/>
+ <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=""../bin/i2ctftpboot_evm6670l.out"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.405326097" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE" value=""../bin/i2ctftpboot_evm6670l.map"" 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=""rts6600_elf.lib""/>
<listOptionValue builtIn="false" value=""ti.platform.evm6670l.ae66""/>
<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>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
- <storageModule moduleId="scannerConfiguration"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="i2cemacboot.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
+ <project id="i2ctftpboot.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
</storageModule>
</cproject>
diff --git a/boot_loader/examples/i2c/emac/evmc6670l/.project b/boot_loader/examples/i2c/tftp/evmc6670l/.project
similarity index 92%
rename from boot_loader/examples/i2c/emac/evmc6670l/.project
rename to boot_loader/examples/i2c/tftp/evmc6670l/.project
index 459c24e38ae0a40a6d5c7a645565fef8d8ab1b83..a8fbd18ff885404d61f43d84d06d652cebfd8b2a 100644 (file)
rename from boot_loader/examples/i2c/emac/evmc6670l/.project
rename to boot_loader/examples/i2c/tftp/evmc6670l/.project
index 459c24e38ae0a40a6d5c7a645565fef8d8ab1b83..a8fbd18ff885404d61f43d84d06d652cebfd8b2a 100644 (file)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>i2cemacboot_evmc6670l</name>
+ <name>i2ctftpboot_evmc6670l</name>
<comment></comment>
<projects>
</projects>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
- <value>${workspace_loc:/i2cemacboot/Debug}</value>
+ <value>${workspace_loc:/i2ctftpboot/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<link>
<name>README.txt</name>
<type>1</type>
- <location>TI_MCSDK_I2CEXAMPLES_DIR/emac/docs/README.txt</location>
+ <location>TI_MCSDK_I2CEXAMPLES_DIR/tftp/docs/README.txt</location>
</link>
<link>
<name>src</name>
<type>2</type>
- <locationURI>TI_MCSDK_I2CEXAMPLES_DIR/emac/src</locationURI>
+ <locationURI>TI_MCSDK_I2CEXAMPLES_DIR/tftp/src</locationURI>
</link>
</linkedResources>
</projectDescription>
diff --git a/boot_loader/examples/i2c/emac/evmc6670l/i2c_boot_emac_example.cmd b/boot_loader/examples/i2c/tftp/evmc6670l/i2c_boot_tftp_example.cmd
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6670l/i2c_boot_emac_example.cmd
rename to boot_loader/examples/i2c/tftp/evmc6670l/i2c_boot_tftp_example.cmd
rename from boot_loader/examples/i2c/emac/evmc6670l/i2c_boot_emac_example.cmd
rename to boot_loader/examples/i2c/tftp/evmc6670l/i2c_boot_tftp_example.cmd
diff --git a/boot_loader/examples/i2c/emac/evmc6670l/macros.ini b/boot_loader/examples/i2c/tftp/evmc6670l/macros.ini
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6670l/macros.ini
rename to boot_loader/examples/i2c/tftp/evmc6670l/macros.ini
rename from boot_loader/examples/i2c/emac/evmc6670l/macros.ini
rename to boot_loader/examples/i2c/tftp/evmc6670l/macros.ini
diff --git a/boot_loader/examples/i2c/emac/evmc6678l/.ccsproject b/boot_loader/examples/i2c/tftp/evmc6678l/.ccsproject
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6678l/.ccsproject
rename to boot_loader/examples/i2c/tftp/evmc6678l/.ccsproject
rename from boot_loader/examples/i2c/emac/evmc6678l/.ccsproject
rename to boot_loader/examples/i2c/tftp/evmc6678l/.ccsproject
diff --git a/boot_loader/examples/i2c/emac/evmc6678l/.cproject b/boot_loader/examples/i2c/tftp/evmc6678l/.cproject
similarity index 95%
rename from boot_loader/examples/i2c/emac/evmc6678l/.cproject
rename to boot_loader/examples/i2c/tftp/evmc6678l/.cproject
index da96a73cea7034f6e625140b86a8281d608245d9..4d71d4ce0ee36efec2697c438ddf9d37b9e3f718 100644 (file)
rename from boot_loader/examples/i2c/emac/evmc6678l/.cproject
rename to boot_loader/examples/i2c/tftp/evmc6678l/.cproject
index da96a73cea7034f6e625140b86a8281d608245d9..4d71d4ce0ee36efec2697c438ddf9d37b9e3f718 100644 (file)
<?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/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="out" artifactName="../bin/i2cemacboot_evm6678l" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
+ <configuration artifactExtension="out" artifactName="../bin/i2ctftpboot_evm6678l" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
<folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain.2097842143" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.854128311">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.732314103" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug.30003368" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug"/>
- <builder buildPath="${workspace_loc:/i2cemacboot/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1571910857" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug"/>
+ <builder buildPath="${workspace_loc:/i2ctftpboot/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1571910857" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug.1787566966" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING.1206666269" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
<inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS.2124959934" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.854128311" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug">
- <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE.572435525" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE" value=""../bin/i2cemacboot_evm6678l.out"" valueType="string"/>
- <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.405326097" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE" value=""../bin/i2cemacboot_evm6678l.map"" valueType="string"/>
+ <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=""../bin/i2ctftpboot_evm6678l.out"" valueType="string"/>
+ <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.405326097" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE" value=""../bin/i2ctftpboot_evm6678l.map"" 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=""rts6600_elf.lib""/>
<listOptionValue builtIn="false" value=""ti.platform.evm6678l.ae66""/>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
- <storageModule moduleId="scannerConfiguration"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="i2cemacboot.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
+ <project id="i2ctftpboot.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
</storageModule>
</cproject>
diff --git a/boot_loader/examples/i2c/emac/evmc6678l/.project b/boot_loader/examples/i2c/tftp/evmc6678l/.project
similarity index 92%
rename from boot_loader/examples/i2c/emac/evmc6678l/.project
rename to boot_loader/examples/i2c/tftp/evmc6678l/.project
index e1f5627b96ef66e8ebc9017ad19a8aefb63a1c2f..bf80801958bdf81b7c2ab904ab5bcad25a8c2ace 100644 (file)
rename from boot_loader/examples/i2c/emac/evmc6678l/.project
rename to boot_loader/examples/i2c/tftp/evmc6678l/.project
index e1f5627b96ef66e8ebc9017ad19a8aefb63a1c2f..bf80801958bdf81b7c2ab904ab5bcad25a8c2ace 100644 (file)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>i2cemacboot_evmc6678l</name>
+ <name>i2ctftpboot_evmc6678l</name>
<comment></comment>
<projects>
</projects>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
- <value>${workspace_loc:/i2cemacboot/Debug}</value>
+ <value>${workspace_loc:/i2ctftpboot/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<link>
<name>README.txt</name>
<type>1</type>
- <location>TI_MCSDK_I2CEXAMPLES_DIR/emac/docs/README.txt</location>
+ <location>TI_MCSDK_I2CEXAMPLES_DIR/tftp/docs/README.txt</location>
</link>
<link>
<name>src</name>
<type>2</type>
- <locationURI>TI_MCSDK_I2CEXAMPLES_DIR/emac/src</locationURI>
+ <locationURI>TI_MCSDK_I2CEXAMPLES_DIR/tftp/src</locationURI>
</link>
</linkedResources>
</projectDescription>
diff --git a/boot_loader/examples/i2c/emac/evmc6678l/i2c_boot_emac_example.cmd b/boot_loader/examples/i2c/tftp/evmc6678l/i2c_boot_tftp_example.cmd
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6678l/i2c_boot_emac_example.cmd
rename to boot_loader/examples/i2c/tftp/evmc6678l/i2c_boot_tftp_example.cmd
rename from boot_loader/examples/i2c/emac/evmc6678l/i2c_boot_emac_example.cmd
rename to boot_loader/examples/i2c/tftp/evmc6678l/i2c_boot_tftp_example.cmd
diff --git a/boot_loader/examples/i2c/emac/evmc6678l/macros.ini b/boot_loader/examples/i2c/tftp/evmc6678l/macros.ini
similarity index 100%
rename from boot_loader/examples/i2c/emac/evmc6678l/macros.ini
rename to boot_loader/examples/i2c/tftp/evmc6678l/macros.ini
rename from boot_loader/examples/i2c/emac/evmc6678l/macros.ini
rename to boot_loader/examples/i2c/tftp/evmc6678l/macros.ini
diff --git a/boot_loader/examples/i2c/emac/src/i2c_boot_emac_example.c b/boot_loader/examples/i2c/tftp/src/i2c_boot_tftp_example.c
similarity index 100%
rename from boot_loader/examples/i2c/emac/src/i2c_boot_emac_example.c
rename to boot_loader/examples/i2c/tftp/src/i2c_boot_tftp_example.c
rename from boot_loader/examples/i2c/emac/src/i2c_boot_emac_example.c
rename to boot_loader/examples/i2c/tftp/src/i2c_boot_tftp_example.c
index c3aef5909109481b758e6f45aff2e3fe26f625ee..0c6d54ca0d08516e4ca5478e76dc797d952101ac 100644 (file)
mv -f MAD_UG.doc mad-utils\MAD_UG.doc
+rm -f examples\srio\docs\readme.doc
+
+rm -f -r ..\factory_images
diff --git a/post/docs/README.txt b/post/docs/README.txt
index 7ba3937b5b5f78242e63df4a28ce1b4a4afc72cd..9ce271a62eddad30ded9414068a8c5c3cd26982a 100644 (file)
--- a/post/docs/README.txt
+++ b/post/docs/README.txt
change "C6000_CG_DIR", "TARGET", "ENDIAN" and "IBL_ROOT_DIR" parameters accordingly.
3. Double click post_romparse.bat. This will generate a CCS format image file "post_i2crom.dat", which can be programmed
- to I2C EEPROM slave bus address 80 (0x50), below are the steps how to program the EEPROM using the EEPROM writer utility:
+ to I2C EEPROM slave bus address 0x50, below are the steps how to program the EEPROM using the EEPROM writer utility:
* Copy post_i2crom.dat to tools\writer\eeprom\evmc66xxl\bin directory and rename it to "app.dat".
- * Change bus_addr to "80" (0x50) and swap_data to "0" in tools\writer\eeprom\evmc66xxl\bin\eepromwriter_input.txt and save the file.
+ * Change bus_addr to 0x50 and swap_data to "0" in tools\writer\eeprom\evmc66xxl\bin\eepromwriter_input.txt and save the file.
* Refer to tools\writer\eeprom\evmc66xxl\docs\README.txt on how to program the CCS data file to EEPROM.
4. Once the programming is completed successfully, user can set the boot mode to I2C mode with bus address 0x50 and
boot the POST directly from the EEPROM after POR. The boot status and test result can be monitored using the Hyper
Terminal as mentioned in "Steps to run POST in CCSv5".
-Please refer to BIOS MCSDK 2.0 User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
\ No newline at end of file
+Please refer to C6678L/C6670L EVM boot mode dip switch settings:
+http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
+
+and User's Guide for more details:
+http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide
\ No newline at end of file
index f0519a6069cbf15f52d283015318967bc9b79ad7..c2703189d9893bf7a53fa8e6e120e2900b17ac9c 100644 (file)
--- a/post/evmc6670l/.cproject
+++ b/post/evmc6670l/.cproject
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6670:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6670:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6670_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/post/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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.SILICON_VERSION.261244470" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.SILICON_VERSION" value="6600" valueType="string"/>
index f24b5744b9820a792bf62b87296e2a5fd4bd885b..cd42df0a84bcab7a647d634ec81e949e3432300d 100644 (file)
set C6000_CG_DIR="C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c6000"
set TARGET=6670
set ENDIAN=little
-set IBL_ROOT_DIR="C:\Program Files\Texas Instruments\mcsdk_2_00_00_beta2\tools\boot_loader\ibl"
+set IBL_ROOT_DIR="..\..\..\boot_loader\ibl"
set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
index f6d801a53fd103f07a7898d30b1044f4c656ba9d..9d9dde1264ef949e3661ccb8d7ce33980d6732dc 100644 (file)
--- a/post/evmc6678l/.cproject
+++ b/post/evmc6678l/.cproject
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6678L:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/post/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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.SILICON_VERSION.261244470" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.SILICON_VERSION" value="6600" valueType="string"/>
index d0be2944386a587d29126f606e22343d6517a271..03d5e5860779a31d4d334a81159727a7fcf70ae5 100644 (file)
set C6000_CG_DIR="C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c6000"
set TARGET=6678
set ENDIAN=little
-set IBL_ROOT_DIR="C:\Program Files\Texas Instruments\mcsdk_2_00_00_beta2\tools\boot_loader\ibl"
+set IBL_ROOT_DIR="..\..\..\boot_loader\ibl"
set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
index 83f0f7d6766c816972d827f9f84f40b31ea10a02..d12f64c287b6e6b8fb929322a7292d053cd4485e 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6670:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6670:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6670_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/eeprom/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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"/>
diff --git a/writer/eeprom/evmc6670l/bin/eepromwriter_input.txt b/writer/eeprom/evmc6670l/bin/eepromwriter_input.txt
index 40c14f0fb1c66a36dacba3117adddda7b0395244..76b3dd90a7986ff08ea8b44d6600ab5e821834c6 100644 (file)
file_name = app.dat
-bus_addr = 81
+bus_addr = 0x51
start_addr = 0
swap_data = 0
index af172631dd4b29260ebf402f024694c5fe9b850b..b3df2e790e097a86ca619b8c191fd6837036f766 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6678L:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/eeprom/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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"/>
diff --git a/writer/eeprom/evmc6678l/bin/eepromwriter_input.txt b/writer/eeprom/evmc6678l/bin/eepromwriter_input.txt
index 40c14f0fb1c66a36dacba3117adddda7b0395244..76b3dd90a7986ff08ea8b44d6600ab5e821834c6 100644 (file)
file_name = app.dat
-bus_addr = 81
+bus_addr = 0x51
start_addr = 0
swap_data = 0
index 4668da6548e6f1f3f2b33febdb00a3a4d7df2f73..90b9eaa5d3c566b775c970b77a3d171ff426876b 100644 (file)
***************************************************************************************/
#include <stdlib.h>
#include <stdio.h>
+#include<ctype.h>
#include <string.h>
#include "platform.h"
#include "types.h"
/* EEPROM writer utility version */
-char version[] = "01.00.00.02";
+char version[] = "01.00.00.03";
/* The input file name is hard coded */
char *input_file = "eepromwriter_input.txt";
return (TRUE);
}
+int32_t
+xtoi
+(
+ char *xs,
+ uint32_t *result
+)
+{
+ uint32_t szlen = strlen(xs);
+ int32_t i, xv, fact;
+
+ if (szlen > 0)
+ {
+ /* Converting more than 32bit hexadecimal value? */
+ if (szlen>8) return 2; /* exit */
+
+ /* Begin conversion here */
+ *result = 0;
+ fact = 1;
+
+ /* Run until no more character to convert */
+ for(i=szlen-1; i>=0 ;i--)
+ {
+ if (isxdigit(*(xs+i)))
+ {
+ if (*(xs+i)>=97)
+ {
+ xv = ( *(xs+i) - 97) + 10;
+ }
+ else if ( *(xs+i) >= 65)
+ {
+ xv = (*(xs+i) - 65) + 10;
+ }
+ else
+ {
+ xv = *(xs+i) - 48;
+ }
+ *result += (xv * fact);
+ fact *= 16;
+ }
+ else
+ {
+ // Conversion was abnormally terminated
+ // by non hexadecimal digit, hence
+ // returning only the converted with
+ // an error value 4 (illegal hex character)
+ return 4;
+ }
+ }
+ return 0;
+ }
+
+ // Nothing to convert
+ return 1;
+}
+
+
/******************************************************************************
* Function: parse_input_file
******************************************************************************/
return FALSE;
}
- eepromWriterInfo.busAddr = (uint32_t)atoi(data);
+ if ((data[0] == '0') && (data[1] == 'x' || data[1] == 'X'))
+ {
+ if (xtoi (&data[2], &eepromWriterInfo.busAddr) != 0)
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ eepromWriterInfo.busAddr = (uint32_t)atoi(data);
+ }
fgets(line, MAX_LINE_LENGTH, fp);
key = (char *)strtok(line, tokens);
index 42b61cce60fa7f227b898246c07cc7dd46dc6bb0..82805bed6786308139bbc1f59fadaa54528716b8 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6670:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6670:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6670_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/nand/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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 28becb1148d0acf60fa9d1343d97327dac5eb08e..8722dc21c1cea0f279928924a2d91cb6f8920099 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6678L:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/nand/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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 3a19512d3f572adebca325b1dcc38034cd22cfe4..df325aee73e77740cb08af2828e53c6a729ab541 100644 (file)
#include "types.h"
/* NAND writer utility version */
-char version[] = "01.00.00.02";
+char version[] = "01.00.00.03";
/* The input file name is hard coded */
char *input_file = "nand_writer_input.txt";
+uint32_t swap_byte = 0;
+
/* Parameters defined in the input_file */
#define FILE_NAME "file_name"
#define START_ADDR "start_addr"
uint32_t block, start_block;
uint8_t *scrach_block;
- scrach_block = malloc(nandWriterInfo.blockSizeBytes);
- if (scrach_block == NULL)
+ if (swap_byte)
{
- printf ("Can not allocate scratch block memory!\n");
- return (FALSE);
+ scrach_block = malloc(nandWriterInfo.blockSizeBytes);
+ if (scrach_block == NULL)
+ {
+ printf ("Can not allocate scratch block memory!\n");
+ return (FALSE);
+ }
}
start_block = nandWriterInfo.startAddr / nandWriterInfo.blockSizeBytes;
if (++block == p_device->block_count)
{
printf ("Flash failed: End of device reached\n");
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
wLen = nandWriterInfo.writeBytes - wPos;
}
- formBlock((uint32_t *)(&nandWriterInfo.writeData[wPos]), nandWriterInfo.blockSizeBytes, scrach_block);
+ if (swap_byte)
+ {
+ formBlock((uint32_t *)(&nandWriterInfo.writeData[wPos]), nandWriterInfo.blockSizeBytes, scrach_block);
+ }
+ else
+ {
+ scrach_block = &nandWriterInfo.writeData[wPos];
+ }
if (platform_device_write(p_device->handle,
block*nandWriterInfo.blockSizeBytes,
scrach_block,
{
printf ("platform_device_write block # %d failed!\n", block);
print_platform_errno();
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (TRUE);
}
uint8_t *scrach_block;
uint32_t *read_data_w;
- scrach_block = malloc(nandWriterInfo.blockSizeBytes);
- if (scrach_block == NULL)
+ if (swap_byte)
{
- printf ("Can not allocate scratch block memory!\n");
- return (FALSE);
+ scrach_block = malloc(nandWriterInfo.blockSizeBytes);
+ if (scrach_block == NULL)
+ {
+ printf ("Can not allocate scratch block memory!\n");
+ return (FALSE);
+ }
}
start_block = nandWriterInfo.startAddr / nandWriterInfo.blockSizeBytes;
if (++block == p_device->block_count)
{
printf ("Flash failed: End of device reached\n");
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
printf ("Reading and verifying block %d (%d bytes of %d)\n", block, rPos, nandWriterInfo.writeBytes);
+ if (!swap_byte)
+ {
+ scrach_block = &nandWriterInfo.readData[rPos];
+
+ }
+
/* Read a block of data */
if(platform_device_read(p_device->handle,
block*nandWriterInfo.blockSizeBytes,
printf ("marking block %d as bad, re-flash attempted\n", block);
markBlockBad (p_device, block);
}
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
/* Convert the packed data */
- read_data_w = (uint32_t *)(&nandWriterInfo.readData[rPos]);
- for (i = 0, j = 0; i < nandWriterInfo.blockSizeBytes; i += 4)
- read_data_w[j++] = (scrach_block[i+0] << 24) | (scrach_block[i+1] << 16) | (scrach_block[i+2] << 8) | scrach_block[i+3];
+ if (swap_byte)
+ {
+ read_data_w = (uint32_t *)(&nandWriterInfo.readData[rPos]);
+ for (i = 0, j = 0; i < nandWriterInfo.blockSizeBytes; i += 4)
+ read_data_w[j++] = (scrach_block[i+0] << 24) | (scrach_block[i+1] << 16) | (scrach_block[i+2] << 8) | scrach_block[i+3];
+ }
rLen = nandWriterInfo.blockSizeBytes;
if (nandWriterInfo.writeBytes - rPos < nandWriterInfo.blockSizeBytes)
{
printf ("Failure in block %d, at byte %d, (at byte %d in the data file) expected 0x%08x, read 0x%08x\n",
block, i, rPos, nandWriterInfo.writeData[i], nandWriterInfo.readData[i]);
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
}
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (TRUE);
}
index fb857e6199e2a8bd042372c11288c27a1113141c..89f87eeed62c71978398a146d4b0b262a38372ab 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6670:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6670:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6670_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/nor/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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 954257cdfad507dceb776d3ecf5f2692560b8ced..4969bbd81b19d2c9275d70102909c92d9f20ecbe 100644 (file)
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rts6600_elf.lib"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
- <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.mcsdk_2.0.0.9:2.0.0.9;com.ti.biosmcsdk.pdk.C6678L:1.0.0.9;"/>
+ <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.10;"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
<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=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform""/>
- <listOptionValue builtIn="false" value=""${TI_MCSDK_INSTALL_DIR}/tools/writer/nor/include""/>
+ <listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../include""/>
</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 ddd8074dded201f55bd157b5cec32c70689cd423..ca32b96053ac93ace4de6fc678c3484e35a473ff 100644 (file)
#include "../include/types.h"
/* NOR writer utility version */
-char version[] = "01.00.00.01";
+char version[] = "01.00.00.02";
/* The input file name is hard coded */
char *input_file = "nor_writer_input.txt";
+uint32_t swap_byte = 0;
+
/* Parameters defined in the input_file */
#define FILE_NAME "file_name"
#define START_ADDR "start_addr"
)
{
uint32_t i, j;
-
+
/* Convert the data to a byte stream */
for (i = j = 0; j < blockSize; i++, j+=4)
{
uint32_t block, start_block;
uint8_t *scrach_block;
- scrach_block = malloc(norWriterInfo.blockSizeBytes);
- if (scrach_block == NULL)
+ if (swap_byte)
{
- printf ("Can not allocate scratch block memory!\n");
- return (FALSE);
+ scrach_block = malloc(norWriterInfo.blockSizeBytes);
+ if (scrach_block == NULL)
+ {
+ printf ("Can not allocate scratch block memory!\n");
+ return (FALSE);
+ }
}
start_block = norWriterInfo.startAddr / norWriterInfo.blockSizeBytes;
{
printf ("Flashing sector %d (%d bytes of %d)\n", block, wPos, norWriterInfo.writeBytes);
- /*if (platform_device_erase_block(p_device->handle, block) != Platform_EOK)
- {
- printf ("NOR erase sector # %d failed!\n", block);
- print_platform_errno();
- free (scrach_block);
- return (FALSE);
- }*/
-
wLen = norWriterInfo.blockSizeBytes;
if (norWriterInfo.writeBytes - wPos < norWriterInfo.blockSizeBytes)
{
wLen = norWriterInfo.writeBytes - wPos;
}
- formBlock((uint32_t *)(&norWriterInfo.writeData[wPos]), norWriterInfo.blockSizeBytes, scrach_block);
+ if (swap_byte)
+ {
+ formBlock((uint32_t *)(&norWriterInfo.writeData[wPos]), norWriterInfo.blockSizeBytes, scrach_block);
+ }
+ else
+ {
+ scrach_block = &norWriterInfo.writeData[wPos];
+ }
if (platform_device_write(p_device->handle,
block*norWriterInfo.blockSizeBytes,
scrach_block,
{
printf ("platform_nor_write sector # %d failed!\n", block);
print_platform_errno();
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (TRUE);
}
uint8_t *scrach_block;
uint32_t *read_data_w;
- scrach_block = malloc(norWriterInfo.blockSizeBytes);
- if (scrach_block == NULL)
+ if (swap_byte)
{
- printf ("Can not allocate scratch block memory!\n");
- return (FALSE);
+ scrach_block = malloc(norWriterInfo.blockSizeBytes);
+ if (scrach_block == NULL)
+ {
+ printf ("Can not allocate scratch block memory!\n");
+ return (FALSE);
+ }
}
start_block = norWriterInfo.startAddr / norWriterInfo.blockSizeBytes;
{
printf ("Reading and verifying sector %d (%d bytes of %d)\n", block, rPos, norWriterInfo.writeBytes);
+ if (!swap_byte)
+ {
+ scrach_block = &norWriterInfo.readData[rPos];
+
+ }
/* Read a sector of data */
if(platform_device_read(p_device->handle,
block*norWriterInfo.blockSizeBytes,
{
printf ("Failure in sector %d\n", block);
print_platform_errno();
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
/* Convert the packed data */
- read_data_w = (uint32_t *)(&norWriterInfo.readData[rPos]);
- for (i = 0, j = 0; i < norWriterInfo.blockSizeBytes; i += 4)
- read_data_w[j++] = (scrach_block[i+0] << 24) | (scrach_block[i+1] << 16) | (scrach_block[i+2] << 8) | scrach_block[i+3];
+ if (swap_byte)
+ {
+ read_data_w = (uint32_t *)(&norWriterInfo.readData[rPos]);
+ for (i = 0, j = 0; i < norWriterInfo.blockSizeBytes; i += 4)
+ read_data_w[j++] = (scrach_block[i+0] << 24) | (scrach_block[i+1] << 16) | (scrach_block[i+2] << 8) | scrach_block[i+3];
+ }
/* Read the data from the file */
rLen = norWriterInfo.blockSizeBytes;
{
printf ("Failure in sector %d, at byte %d, (at byte %d in the data file) expected 0x%08x, read 0x%08x\n",
block, i, rPos, norWriterInfo.writeData[i], norWriterInfo.readData[i]);
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (FALSE);
}
}
}
- free (scrach_block);
+ if (swap_byte) free (scrach_block);
return (TRUE);
}