summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c333f8)
raw | patch | inline | side by side (parent: 2c333f8)
author | Mike Line <m-line1@ti.com> | |
Tue, 19 Oct 2010 18:47:07 +0000 (14:47 -0400) | ||
committer | Mike Line <m-line1@ti.com> | |
Tue, 19 Oct 2010 18:47:07 +0000 (14:47 -0400) |
c6455 ibl added
23 files changed:
index 84eb30d01468c97bce23fc7f782c62004af6a854..0578bb14f6b55ae49e8735aabb91ba1063b64596 100644 (file)
/* Leave mdio disabled */
#define dev_mdio_open() 1
+/* No chip level reset required for ethernet, the function call is made a void statment */
+#define deviceSetEthResetState(x,y)
+
/* The mac control register values used */
#define TARGET_MAC_CONTROL CPMAC_MACCONTROL_RXOWNERSHIP | \
CPMAC_MACCONTROL_RXOFFLENBLOCK | \
*/
#define TARGET_PWR_NAND -1
+/**
+ * @brief
+ * Flag to indicate timer 0 power up requested. The time is always on in the 6472
+ */
+#define TARGET_PWR_TIMER_0 -1
/**
* @brief
index 06cc39b0b13d62115dc34695dc0baec512b411ce..2e1cdba5c33528354c759f18a1e25af77bc2f70a 100644 (file)
/* Leave mdio disabled */
#define dev_mdio_open() 1
+/* No chip level reset required for ethernet, the function call is made a void statment */
+#define deviceSetEthResetState(x,y)
/* The mac control register values */
#define TARGET_MAC_CONTROL ( 1 << 18) /* EXT_EN */ \
*/
#define TARGET_PWR_NAND -1
+/**
+ * @brief
+ * Flag to indicate timer 0 power up requested. The time is always on in the 6474
+ */
+#define TARGET_PWR_TIMER_0 -1
+
/**
* @brief
diff --git a/src/device/device.h b/src/device/device.h
index a58a472a2dcbec842f839697aef49785a87a7c0c..89a5d78e8167cc2286afcdf755e1a3bff71b96b9 100644 (file)
--- a/src/device/device.h
+++ b/src/device/device.h
*/
void deviceLoadDefaultEthAddress (uint8 *maddr);
+/**
+ * @brief
+ * Reset the ethernet controller
+ *
+ * @details
+ * Some devices require an external ethernet reset before configuration
+ */
+#ifndef deviceSetEthResetState
+void deviceSetEthResetState (int32 portNum, BOOL applyReset);
+#endif
+
+
#endif
index 993aea62e00659bd0a6292fbaee2eebc65812595..e3ceca0c301e362b21c98085856e37ce306e86cb 100644 (file)
ifeq ($(TARGET),c6474)
CSRC= t64.c cpmacdrv.c pll.c psc.c emif31.c mdio.c gpio.c nandgpio.c i2c.c nandwrgpio.c sgmii.c
else
- CSRC= t64.c cpmacdrv.c pll.c psc.c emif31.c mdio.c gpio.c nandgpio.c i2c.c nandwrgpio.c sgmii.c
+ ifeq ($(TARGET),c6455)
+ CSRC= t64.c cpmacdrv.c pll.c emif31.c mdio.c gpio.c nandgpio.c i2c.c nandwrgpio.c
+ else
+ CSRC= t64.c cpmacdrv.c pll.c psc.c emif31.c mdio.c gpio.c nandgpio.c i2c.c nandwrgpio.c sgmii.c
+ endif
endif
endif
vpath % $(ECODIR)/sgmii
endif
+ifeq ($(TARGET),c6455)
+ vpath % $(ECODIR)/macs/cpmac
+ vpath % $(ECODIR)/plls/pllxx1p8
+ vpath % $(ECODIR)/ddrs/emif31
+ vpath % $(ECODIR)/mdio
+ vpath % $(ECODIR)/gpio
+ vpath % $(ECODIR)/nands/gpio
+ vpath % $(ECODIR)/i2c
+endif
+
hw: gen_cdefdep makefile $(OBJS)
index d35f37ffd8e499af37ddf08dd58c98a03d6be57d..11adee8b953bb9ab1bb0f3d99ce018f4b07a4d74 100644 (file)
ptr_EMACRegs = (CPMAC_REGS *)(aptr_EMACRegs[ptr_device->port_num]);
pDesc = (EMAC_Desc *)(aptr_EmacDesc[ptr_device->port_num]);
+ /* Some devices require chip level application of reset before device configuration.
+ * Devices that dont require this will define this function call to be a void statement */
+ deviceSetEthResetState (ptr_device->port_num, TRUE);
/* Reset EMAC */
ptr_EMACRegs->SOFTRESET = 0x1;
ptr_EMACRegs->RXUNICASTSET = 1;
ptr_EMACRegs->RXMBPENABLE = CPMAC_RXMBPENABLE_RXBROADEN;
+
+ /* Some devices require chip level application of reset before device configuration.
+ * Devices that dont require this will define this function call to be a void statement */
+ deviceSetEthResetState (ptr_device->port_num, FALSE);
+
/* Initialize the Device MDIO layer: The function returns only when
* the LINK is UP and RUNNING. */
if (dev_mdio_open () < 0)
index ab5e54d1300d0cfff16192306f6382f337eada4c..15a6980f79bbd6189b2fdba9179ab48bcc57de0a 100644 (file)
C6X_C_DIR+= ;$(IBL_ROOT)/hw/i2c
C6X_C_DIR+= ;$(IBL_ROOT)/cfg/$(TARGET)
C6X_C_DIR+= ;$(STDINC)
+
+# Paths to the kicker intermediate boot loader for devices which require them
+ifeq ($(TARGET),c6455)
+ C6X_C_DIR+= ;$(IBL_ROOT)/make/ibl_c6455
+ C6X_C_DIR+= ;$(IBL_ROOT)/util/romparse
+endif
+
+
+
export C6X_C_DIR
diff --git a/src/main/iblmain.c b/src/main/iblmain.c
index d687b3825d12ec4dbebf47fb8c97195a031e0549..317670bf0ef434c3e3c9a4fc43bd6b70f33bb30f 100644 (file)
--- a/src/main/iblmain.c
+++ b/src/main/iblmain.c
memset (&iblStatus, 0, sizeof(iblStatus_t));
iblStatus.iblMagic = ibl_MAGIC_VALUE;
- /* Initialize the system timer (software tracking of the hardware timer state */
- timer_init ();
-#if 0
- /* If there is no magic value in the ibl configuration structure then a default
- * table is used. */
- if (ibl.iblMagic != ibl_MAGIC_VALUE) {
- deviceLoadDefaultIblTable();
- iblStatus.noMagic = 1;
- ibl.iblMagic = ibl_MAGIC_VALUE;
- }
-#endif
+ /* Power up the timer */
+ devicePowerPeriph (TARGET_PWR_TIMER_0);
+
+ /* Initialize the system timer (software tracking of the hardware timer state) */
+ timer_init ();
-#if 0 /* debugging c6472 using ccs download. Remove for i2c config download */
/* Load the default configuration table from the i2c. The actual speed of the device
* isn't really known here, since it is part of the table, so a compile time
}
-#endif
/* Load default mac addresses for ethernet boot if requested */
for (i = 0; i < ibl_N_ETH_PORTS; i++) {
diff --git a/src/make/Makefile b/src/make/Makefile
index 98e414786d802d9182bb9ea9d3dd9e436e989023..31dc4d8080d4eeb01472b5f4f4ff306003ed2991 100644 (file)
--- a/src/make/Makefile
+++ b/src/make/Makefile
make -C ../util/btoccs clean
make -C ../util/i2cConfig clean
make -C ../util/nandWriter clean
- make -C ../util/romparse_c6472 clean
+ make -C ../util/romparse clean
make -C ../test/test1 clean
make -C ../test/test2 clean
index 6d1eba2da91d09169ba19768dc5d9b1225251e5f..5c98b6e30a9ffe8021ae16b7901a9907f6a30376 100644 (file)
# -pds837: shut off #pragma symbol warnings (can be applied to file level symbol only)
# -pds97: shut off no source in file warning
#CFLAGS = -c -k -mi200 -ml3 -o2 -pm -pds1111 -pds827 -pds824 -pds837 -pds1037 -pds195 -pds97 -pden -pdr $(CPUFLAGS)
-CFLAGS = -c -k -mi200 -ml3 -ms3 -o2 -pm -pds1111 -pds827 -pds824 -pds837 -pds1037 -pds195 -pds97 -pden -pdr $(CPUFLAGS)
-#CFLAGS = -c -k -mi200 -ml0 -ms3 -o2 -pm -pds1111 -pds827 -pds824 -pds837 -pds1037 -pds195 -pds97 -pden -pdr $(CPUFLAGS)
+#CFLAGS = -c -k -mi200 -ml3 -ms3 -o2 -pm -pds1111 -pds827 -pds824 -pds837 -pds1037 -pds195 -pds97 -pden -pdr $(CPUFLAGS)
+CFLAGS = -c -k -mi200 -ml0 -ms3 -o2 -pm -pds1111 -pds827 -pds824 -pds837 -pds1037 -pds195 -pds97 -pden -pdr $(CPUFLAGS)
ifeq ($(ENDIAN),big)
CFLAGS+= -me
# -as : keep local symbols
# -g : enable debugging
# -ss : interlist C source and optimizer with .asm source
-DCFLAGS = -g -as -ss
-#DCFLAGS = -as -ss
+#DCFLAGS = -g -as -ss
+DCFLAGS = -as -ss
#DCFLAGS = -gp
index 4f944a5d49e4e63693c158d8ea84b08c2e0198df..24fceadc4efc573ba10088dc7ea47aacb57f3842 100644 (file)
../main/c64x/make/iblmain.oc
../device/c64x/make/c6455.oc
../ethboot/c64x/make/ethboot.oc
+../nandboot/c64x/make/nandboot.oc
../driver/c64x/make/net.oc
../driver/c64x/make/arp.oc
../driver/c64x/make/ip.oc
../driver/c64x/make/timer.oc
../driver/c64x/make/bootp.oc
../driver/c64x/make/tftp.oc
+../driver/c64x/make/nand.oc
../hw/c64x/make/t64.oc
../hw/c64x/make/cpmacdrv.oc
+../hw/c64x/make/pll.oc
+../hw/c64x/make/emif31.oc
+../hw/c64x/make/mdio.oc
+../hw/c64x/make/gpio.oc
+../hw/c64x/make/nandgpio.oc
+../hw/c64x/make/i2c.oc
../interp/c64x/make/bis.oc
+../interp/c64x/make/cload.oc
+../interp/c64x/make/osal.oc
+../interp/c64x/make/btblwrap.oc
+../interp/c64x/make/btblpr.oc
+../interp/c64x/make/gem.oc
+../interp/c64x/make/blob.oc
+../interp/c64x/make/dload.oc
+../interp/c64x/make/elfwrap.oc
+../interp/c64x/make/dlw_client.oc
+../interp/c64x/make/dload_endian.oc
+../interp/c64x/make/ArrayList.oc
+../ecc/c64x/make/3byte_ecc.oc
+
-c
-stack 0x400
+-heap 0x6000
MEMORY
{
- L2 : origin = 0x800000, length = 0x10000
- CFG : origin = 0x810000, length = 0x0200
- STAT : origin = 0x810200, length = 0x0200
+ TEXT : origin = 0x801000, length = 0x20000
+ STACK : origin = 0x821000, length = 0x0800
+ HEAP : origin = 0x821800, length = 0x6000
+ DATA : origin = 0x827800, length = 0x3000
+ CFG : origin = 0x831800, length = 0x0300
+ STAT : origin = 0x831b00, length = 0x0200
}
SECTIONS
{
- .stack > L2
- .cinit > L2
- .const > L2
- .text > L2
- .far > L2
- .switch > L2
- .bss > L2
+ .stack > STACK
+ .sysmem > HEAP
+ .cinit > TEXT
+ .const > TEXT
+ .text > TEXT
+ .switch > TEXT
+ .far > DATA
+ .bss > DATA
.ibl_config_table > CFG
.ibl_status_table > STAT
diff --git a/src/make/makestg2 b/src/make/makestg2
index 8df3ede64765da85b581e406d313475fe0df568b..75855bc8ec55f36d8a03483f1b36c84f932a6221 100644 (file)
--- a/src/make/makestg2
+++ b/src/make/makestg2
MODULES= main device ethboot nandboot driver hw interp ecc
CLEAN_MODULES=$(addprefix clean_,$(MODULES))
-TARGETS= c6472 c6474
+TARGETS= c6472 c6474 c6455
ifeq ($(ENDIAN),little)
HEX_OPT= -order L
export ARCH
export TARGET
-#CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
-#export CDEFS
-
-c6455: $(MODULES)
- $(LD) -o ibl_$@/ibl_$@.out -m ibl_$@/ibl_$@.map ibl_$@/ibl.cmd $(RTLIBS)
-
-
-$(TARGETS): $(MODULES) utils
+$(TARGETS): $(MODULES) utils $(RIBL)
$(LD) -o ibl_$@/ibl_$@.out -m ibl_$@/ibl_$@.map ibl_$@/ibl.cmd $(RTLIBS)
hex6x $(HEX_OPT) ibl_$@/ibl.rmd ibl_$@/ibl_$@.out
../util/bconvert/bconvert64x -$(IEXT) ibl_le.b ibl.b
$(CP) ibl.b ibl_$@
../util/btoccs/b2i2c ibl_$@/ibl.b ibl_$@/ibl.i2c.b
../util/btoccs/b2ccs ibl_$@/ibl.i2c.b ibl_$@/ibl.i2c.ccs
- ../util/romparse_$@/romparse ibl_$@/i2crom_$(IEXT).map
+ ../util/romparse/romparse ibl_$@/i2crom_$(IEXT).map
$(CP) i2crom.ccs ibl_$@/i2crom_$(IEXT).ccs
$(CP) i2crom.ccs ibl_$@/i2crom_$(IEXT).dat
$(RM) i2crom.ccs ibl_le.b ibl.b
@echo making $@
make -C $(IBL_ROOT)/$@/$(ARCH)/make $@
+
utils:
make -C $(IBL_ROOT)/util/btoccs
-# make -C $(IBL_ROOT)/util/romparse_$(TARGET)
+ make -C $(IBL_ROOT)/util/romparse TARGET=$(TARGET)
+ make -C $(IBL_ROOT)/util/i2cRead TARGET=$(TARGET) $(TARGET)
+ make -C $(IBL_ROOT)/util/i2cWrite TARGET=$(TARGET) $(TARGET)
make -C $(IBL_ROOT)/util/bconvert
clean: $(CLEAN_MODULES)
diff --git a/src/mkdeppath.bat b/src/mkdeppath.bat
index d2ed0411507fcb006832b0139bfcd3726f66494c..b530241c902e0afe666551519950b8318724e74a 100644 (file)
--- a/src/mkdeppath.bat
+++ b/src/mkdeppath.bat
set MAKEDEPPATH=/data/projects/ibl/git/ibl/src/make/makedep/makedep.exe
+
index c8199ab1cabf39ddbb352befc700aeb77fa44af8..e87e06bc2699914365bdc35c5a2865fcaffef70e 100644 (file)
#*
#***************************************************************
-DEVICES= c6472
+DEVICES= c6455 c6472 c6474
all:
@echo must specify a target [ $(DEVICES) ]
index 28f63645d9633d7d8a5fb4307c0b5e67d2cac092..d89630440d62c7fa9fa2e0c79f175c4ed4d3b45b 100644 (file)
* @brief The desired ibl configuration is setup here. Edit the fields
* to match the desired setup.
*/
+
+#if 0
void setupTable (void)
{
ibl.ethConfig[1].bootFormat = ibl_BOOT_FORMAT_BBLOB;
+ /* SGMII */
+
+
/* Leave the hardware address as 0 so the e-fuse value will be used */
/* Leave all remaining fields as 0 since bootp will fill them in */
}
+#endif
+
/**
* @brief
volatile Int32 i;
+ printf ("Run the GEL for for the device to be configured, press return to program the I2C\n");
+ getchar ();
/* Program the main system PLL */
hwPllSetPll (MAIN_PLL,
- 1, /* Pre-divider */
- IBL_I2C_DEV_FREQ_MHZ / 25, /* Multiplier */
- 1); /* Post-divider */
+ ibl.pllConfig[ibl_MAIN_PLL].prediv, /* Pre-divider */
+ ibl.pllConfig[ibl_MAIN_PLL].pllOutFreqMhz, /* Multiplier */
+ ibl.pllConfig[ibl_MAIN_PLL].postdiv); /* Post-divider */
- setupTable();
- hwI2Cinit (IBL_I2C_DEV_FREQ_MHZ, /* The CPU frequency during I2C data load */
- DEVICE_I2C_MODULE_DIVISOR, /* The divide down of CPU that drives the i2c */
- IBL_I2C_CLK_FREQ_KHZ/8, /* The I2C data rate used during table load. Slowed for writes */
- IBL_I2C_OWN_ADDR); /* The address used by this device on the i2c bus */
+ hwI2Cinit (ibl.pllConfig[ibl_MAIN_PLL].pllOutFreqMhz, /* The CPU frequency during I2C data load */
+ DEVICE_I2C_MODULE_DIVISOR, /* The divide down of CPU that drives the i2c */
+ IBL_I2C_CLK_FREQ_KHZ/8, /* The I2C data rate used during table load. Slowed for writes */
+ IBL_I2C_OWN_ADDR); /* The address used by this device on the i2c bus */
/* Block the data into 64 byte blocks aligned on 64 byte boundaries for the data write.
index e240d7b807b27eebfe0b516048c0d7093b7ddbd5..67219e7f3316d43350a3650836e1e5e1b04fd8c0 100644 (file)
#*
#**************************************************************************
+DEVICES= c6455 c6472 c6474
+
ifndef IBL_ROOT
IBL_ROOT=../..
endif
.PHONY: i2cparam.cmd
-c6472: gen_cdefdep $(MODULES) $(OBJS) i2cparam_$(TARGET).cmd
- $(LD) -o i2cparam_$(TARGET).out -m i2cparam_$(TARGET).map i2cparam_$(TARGET).cmd $(RTLIBS)
+$(DEVICES): gen_cdefdep $(MODULES) $(OBJS) i2cparam.cmd
+ $(LD) -o i2cparam_$(TARGET).out -m i2cparam_$(TARGET).map i2cparam.cmd $(RTLIBS)
$(MODULES):
@echo making $@
diff --git a/src/util/romparse_c6472/Makefile b/src/util/romparse_c6472/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-
-romparse: rparse.tab.o lex.yy.o romparse.c
- gcc -o romparse romparse.c rparse.tab.o lex.yy.o -I../.. -I.
-
-
-rparse.tab.o: rparse.y
- bison -d -S ./bison.simple rparse.y
- gcc -c rparse.tab.c
-
-lex.yy.o: rparse.flex
- flex rparse.flex
- gcc -c lex.yy.c
-
-
-clean:
- rm -f romparse.exe rparse.tab.o lex.yy.o lex.yy.c rparse.tab.c rparse.tab.h
-
-
-
-
-
-
-
diff --git a/src/util/romparse_c6472/bison.simple b/src/util/romparse_c6472/bison.simple
+++ /dev/null
@@ -1,692 +0,0 @@
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "bison.simple"
-
-/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-#ifndef alloca
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
-#include <alloca.h>
-#else /* not sparc */
-#if defined (MSDOS) && !defined (__TURBOC__)
-#include <malloc.h>
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-#include <malloc.h>
- #pragma alloca
-#else /* not MSDOS, __TURBOC__, or _AIX */
-#ifdef __hpux
-#ifdef __cplusplus
-extern "C" {
-void *alloca (unsigned int);
-};
-#else /* not __cplusplus */
-void *alloca ();
-#endif /* not __cplusplus */
-#endif /* __hpux */
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc. */
-#endif /* not GNU C. */
-#endif /* alloca not defined. */
-
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-/* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
-#define YYEOF 0
-#define YYACCEPT return(0)
-#define YYABORT return(1)
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-#define YYFAIL goto yyerrlab
-#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-#ifndef YYPURE
-#define YYLEX yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int yychar; /* the lookahead symbol */
-YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
-#endif
-
-int yynerrs; /* number of parse errors so far */
-#endif /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
-#endif
-
-/* YYINITDEPTH indicates the initial size of the parser's stacks */
-
-#ifndef YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-int yyparse (void);
-#endif
-\f
-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
-#else /* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (to, from, count)
- char *to;
- char *from;
- int count;
-{
- register char *f = from;
- register char *t = to;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (char *to, char *from, int count)
-{
- register char *f = from;
- register char *t = to;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#endif
-#endif
-\f
-#line 196 "bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-int
-yyparse(YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
-{
- register int yystate;
- register int yyn;
- register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
-
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
-
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-
-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK (yyvsp--, yyssp--)
-#endif
-
- int yystacksize = YYINITDEPTH;
-
-#ifdef YYPURE
- int yychar;
- YYSTYPE yylval;
- int yynerrs;
-#ifdef YYLSP_NEEDED
- YYLTYPE yylloc;
-#endif
-#endif
-
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
-
- int yylen;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
-#endif
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss - 1;
- yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
- yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in yystate . */
-/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
-yynewstate:
-
- *++yyssp = yystate;
-
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Give user a chance to reallocate the stack */
- /* Use copies of these so that the &'s don't force the real ones into memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
-#endif
-
- /* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
-#ifdef YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
-#else
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
-#endif
-
- yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
- yyls = yyls1;
-#endif
-#else /* no yyoverflow */
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- return 2;
- }
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
- yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
- goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
- if (yychar == YYEMPTY)
- {
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
-#endif
- yychar = YYLEX;
- }
-
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
-#endif
- }
- else
- {
- yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise meaning
- of a token, for further debugging info. */
-#ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
-#endif
- fprintf (stderr, ")\n");
- }
-#endif
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
-
- yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-/* Do the default action for the current state. */
-yydefault:
-
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
-
-/* Do a reduction. yyn is the number of a rule to reduce with. */
-yyreduce:
- yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- int i;
-
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symbols being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
-
-$ /* the action file gets copied in in place of this dollarsign */
-#line 498 "bison.simple"
-\f
- yyvsp -= yylen;
- yyssp -= yylen;
-#ifdef YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
- *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
-#endif
-
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
-
- goto yynewstate;
-
-yyerrlab: /* here on detecting error */
-
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
-
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
- {
- strcpy(msg, "parse error");
-
- if (count < 5)
- {
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
- yyerror ("parse error; also virtual memory exceeded");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
-
- goto yyerrlab1;
-yyerrlab1: /* here on error raised explicitly by an action */
-
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
- yychar = YYEMPTY;
- }
-
- /* Else will try to reuse lookahead token
- after shifting the error token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
-
-yyerrdefault: /* current state does not do anything special for the error token. */
-
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
-#endif
-
-yyerrpop: /* pop the current state because it cannot handle the error token */
-
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
- yylsp--;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
-yyerrhandle:
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
-
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
-
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
-#endif
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- yystate = yyn;
- goto yynewstate;
-}
diff --git a/src/util/romparse_c6472/romparse.c b/src/util/romparse_c6472/romparse.c
+++ /dev/null
@@ -1,419 +0,0 @@
-/*************************************************************************************
- * FILE PURPOSE: Create an I2C rom with multiple boot parameter sections and
- * programs
- *************************************************************************************
- * FILE NAME: romparse.c
- *
- * DESCRIPTION: Creates a ccs hex file which contains the i2c eprom boot parameter
- * tables as well as any code.
- *
- *************************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include "rparse.tab.h"
-#include "romparse.h"
-
-/*************************************************************************************
- * Definition: fixed i2c map locations
- *************************************************************************************/
-#define PCI_PARAM_BASE (NUM_BOOT_PARAM_TABLES * 0x80)
-#define DATA_BASE (PCI_PARAM_BASE + PCI_EEAI_PARAM_SIZE)
-
-
-
-/*************************************************************************************
- * Declaration: The flex input file is assigned based on the command line
- *************************************************************************************/
-extern FILE *yyin;
-
-/*************************************************************************************
- * Declaration: The boot parameter tables. The current table is copied into position
- * when the section parse is complete.
- *************************************************************************************/
-BOOT_PARAMS_T boot_params[NUM_BOOT_PARAM_TABLES];
-BOOT_PARAMS_T current_table;
-int ctable_index = -1; /* Destination of current table */
-
-/************************************************************************************
- * Declaration: The structure storing the program data files, and the number of
- * programs used.
- ************************************************************************************/
-progFile_t progFile[NUM_BOOT_PARAM_TABLES];
-int nProgFiles = 0;
-
-/************************************************************************************
- * Declaration: The PCI parameter structure
- ************************************************************************************/
-pciFile_t pciFile;
-int pciSet = 0;
-
-/*************************************************************************************
- * Declaration: The next free address in the ROM for general data usage. For the
- * start address there is room for the initial boot parameter tables,
- * plus room for the PCI eeai config.
- *************************************************************************************/
-int romBase = DATA_BASE;
-
-/*************************************************************************************
- * FUNCTION PURPOSE: flex/bison required support functions.
- *************************************************************************************
- * DESCRIPTION: yyerror and yywrap are required to support flex and/or bison parsing
- * of the parameter description file. yyerror directly reports the
- * error, yywrap is unused.
- *************************************************************************************/
-void yyerror (char *s)
-{
- fprintf (stderr, "flex/bison error is %s\n", s);
-} /* yyerror */
-
-void yywrap (void)
-{
-} /* yywrap */
-
-/*************************************************************************************
- * FUNCTION PURPOSE: Initialize a boot table
- *************************************************************************************
- * DESCRIPTION: Sets a boot parameter table to 0s
- *************************************************************************************/
-void initTable (BOOT_PARAMS_T *current_table)
-{
- memset (current_table, 0, sizeof(BOOT_PARAMS_T));
-}
-
-/*************************************************************************************
- * FUNCTION PURPOSE: Complete a section
- *************************************************************************************
- * DESCRIPTION: The parser has detected a complete section. Copy the section into
- * it's correct table location.
- *************************************************************************************/
-void section (void)
-{
- /* It's an error if no section value has been declared */
- if (ctable_index == -1) {
- fprintf (stderr, "romparse: the section did not have a boot paramter index specified\n");
- exit (-1);
- }
-
- /* Make sure the table is in range */
- if (ctable_index >= NUM_BOOT_PARAM_TABLES) {
- fprintf (stderr, "romparse: The section index is too large (max %d)\n", NUM_BOOT_PARAM_TABLES-1);
- exit (-1);
- }
-
- /* The length must be set. Currently this program only supports I2C mode, so the
- * length is fixed */
- current_table.common.length = 30;
- current_table.common.checksum = 0;
-
- /* Copy the table */
- memcpy (&boot_params[ctable_index], ¤t_table, sizeof (BOOT_PARAMS_T));
- initTable (¤t_table);
-
- ctable_index = -1;
-
-} /* section */
-
-/***************************************************************************************
- * FUNCTION PURPOSE: Open a ccs hex file and read in the data.
- ***************************************************************************************
- * DESCRIPTION: Reads a ccs hex format data file, loads the file into the
- * next program file structure. Returns the index of the just loaded
- * table.
- ***************************************************************************************/
-int openProgFile (char *fname)
-{
- FILE *str;
- int a, b, c, d, e;
- int i;
- char iline[132];
-
- /* Store the file name */
- strcpy (progFile[nProgFiles].fname, fname);
-
- /* Open the data file */
- str = fopen (fname, "r");
- if (str == NULL) {
- fprintf (stderr, "romparse: Could not open file %s\n", fname);
- exit (-1);
- }
-
- /* Put the section at the next available i2c rom address */
- progFile[nProgFiles].addressBytes = romBase;
-
- /* Read the one line ccs header. The length field in terms of lines */
- fgets (iline, 132, str);
- sscanf (iline, "%x %x %x %x %x", &a, &b, &c, &d, &e);
- progFile[nProgFiles].sizeBytes = e * 4; /* Length was in 4 byte words */
-
- /* Read in the data */
- for (i = 0; i < e; i++) {
- fgets (iline, 132, str);
- sscanf (&(iline[2]), "%x", &((progFile[nProgFiles]).data[i]));
- }
-
- fclose (str);
-
- /* Update the next free rom base */
- romBase = romBase + progFile[nProgFiles].sizeBytes;
-
- i = nProgFiles;
- nProgFiles += 1;
-
- return (i);
-
-} /* openProgFile */
-
-/***************************************************************************************
- * FUNCTION PURPOSE: Load the PCI paramter section
- ***************************************************************************************
- * DESCRIPTION: Loads the PCI parameter section and stores it in the rom. */
-int setPciParams (char *fname)
-{
- FILE *str;
- int a, b, c, d, e;
- int i;
- char iline[132];
- char *z;
-
- if (pciSet) {
- fprintf (stderr, "romparse: PCI parameters specified more then once\n");
- exit (-1);
- }
-
- /* the input string still contains the quotes. Remove them here */
- z = &fname[1];
- *strchr (z, '"') = '\0';
-
- /* Store the file name */
- strcpy (pciFile.fname, z);
-
- /* Open the data file */
- str = fopen (z, "r");
- if (str == NULL) {
- fprintf (stderr, "romparse: Could not open pci file %s\n", fname);
- exit (-1);
- }
-
- /* The address of the pci params is currently fixed */
- pciFile.addressBytes = PCI_PARAM_BASE;
-
- /* Read the one line ccs header. The length field is in terms of lines */
- fgets (iline, 132, str);
- sscanf (iline, "%x %x %x %x %x", &a, &b, &c, &d, &e);
- pciFile.sizeBytes = e * 4; /* Convert length to bytes */
-
- /* Read in the data */
- for (i = 0; i < e; i++) {
- fgets (iline, 132, str);
- sscanf (&(iline[2]), "%x", &(pciFile.data[i]));
- }
-
- pciSet = 1;
-
- return (0);
-
-} /* setPciParams */
-
-
-
-/***************************************************************************************
- * FUNCTION PURPOSE: Store an assignment
- ***************************************************************************************
- * DESCRIPTION: Stores an assigned value into the current boot parameter table
- ***************************************************************************************/
-void assignKeyVal (int field, int value)
-{
- switch (field) {
-
- case BOOT_MODE: current_table.common.boot_mode = value;
- break;
-
- case PARAM_INDEX: ctable_index = value;
- break;
-
- case OPTIONS: current_table.i2c.options = value;
- break;
-
- case MULTI_I2C_ID: current_table.i2c.multi_i2c_id = value;
- break;
-
- case MY_I2C_ID: current_table.i2c.my_i2c_id = value;
- break;
-
- case CORE_FREQ_MHZ: current_table.i2c.core_freq_mhz = value;
- break;
-
- case I2C_CLK_FREQ_KHZ: current_table.i2c.i2c_clk_freq_khz = value;
- break;
-
- case NEXT_DEV_ADDR: current_table.i2c.next_dev_addr = value;
- break;
-
- case NEXT_DEV_ADDR_EXT: current_table.i2c.next_dev_addr_ext = value;
- break;
-
- case ADDRESS_DELAY: current_table.i2c.address_delay = value;
- break;
-
- case SWPLL: current_table.i2c.swPll = value;
- break;
-
- case DEV_ADDR_EXT: current_table.i2c.dev_addr_ext = value;
- break;
-
-
- }
-
-} /* assignKeyVal */
-
-
-/*******************************************************************************
- * FUNCTION PURPOSE: Parse a string input.
- *******************************************************************************
- * DESCRIPTION: Takes a string input. Currently only the i2c exe file name can be
- * assigned a string.
- *******************************************************************************/
-void assignKeyStr (int value, char *y)
-{
- int i;
- char *z;
-
-
- /* the input string still contains the quotes. Remove them here */
- z = &y[1];
- *strchr (z, '"') = '\0';
-
- /* Check if the file name is already open */
- for (i = 0; i < nProgFiles; i++) {
-
- if (!strcmp (z, progFile[i].fname)) {
- /* Found a match - copy the address */
- current_table.i2c.dev_addr = progFile[i].addressBytes & 0xffff;
- if (current_table.i2c.dev_addr_ext == 0)
- current_table.i2c.dev_addr_ext = 0x50; /* hard coded to i2c rom slave address */
- return;
- }
-
- }
-
- /* Open and read the ccs file, set the ROM address */
- i = openProgFile (z);
- if (i >= 0) {
- current_table.i2c.dev_addr = progFile[i].addressBytes & 0xffff;
- if (current_table.i2c.dev_addr_ext == 0)
- current_table.i2c.dev_addr_ext = 0x50;
- }
-
-} /* assignKeyStr */
-
-
-/************************************************************************************
- * FUNCTION PURPOSE: Opens and writes the output file
- ************************************************************************************
- * DESCRIPTION: Creates the output file in ccs format.
- ************************************************************************************/
-void createOutput (void)
-{
- FILE *str;
- int totalLenBytes;
- int i, j;
- unsigned int value, v1, v2;
-
- str = fopen ("i2crom.ccs", "w");
- if (str == NULL) {
- fprintf (stderr, "romparse: Could not open output file i2crom.ccs for writing\n");
- exit (-1);
- }
-
- /* Compute the total size of the i2c prom. Include all the i2c boot paramater tables,
- * as well as the PCI parameter table, (which is not necessarily present). */
- totalLenBytes = DATA_BASE;
-
- for (i = 0; i < nProgFiles; i++)
- totalLenBytes += progFile[i].sizeBytes;
-
- /* Write out the ccs header */
- fprintf (str, "1651 1 10000 1 %x\n", totalLenBytes >> 2);
-
- /* Write out the boot parameter tables. 0x80 bytes will be written out.
- * There are 16 bits in every parameter field, which is why the index
- * is from 0 to 0x40 */
- for (i = 0; i < NUM_BOOT_PARAM_TABLES; i++) {
- for (j = 0; j < (0x80 >> 1); j += 2) {
- v1 = boot_params[i].parameter[j];
- v2 = boot_params[i].parameter[j+1];
- value = (v1 << 16) | v2;
- fprintf (str, "0x%08x\n", value);
- }
- }
-
- /* Write out the PCI parameter base. If none was included then zeros will be
- * written out */
- for (i = 0; i < PCI_DATA_LEN_32bit; i++) {
- fprintf (str, "0x%08x\n", pciFile.data[i]);
- }
-
-
- /* Write out each of the program files */
- for (i = 0; i < nProgFiles; i++)
- for (j = 0; j < progFile[i].sizeBytes >> 2; j++)
- fprintf (str, "0x%08x\n", (progFile[i]).data[j]);
-
-
- /* Close the input file */
- fclose (str);
-
-} /* createOutput */
-
-/************************************************************************************
- * FUNCTION PURPOSE: Initialize the pci paramter table
- ************************************************************************************
- * DESCRIPTION: Zeros the pci parameters
- ************************************************************************************/
-void initPciParams (void)
-{
- memset (&pciFile, 0, sizeof(pciFile_t));
-} /* initPciParams */
-
-/************************************************************************************
- * FUNCTION PURPOSE: main function
- ************************************************************************************
- * DESCRIPTION: Performs the processing sequence.
- ************************************************************************************/
-int main (int argc, char *argv[])
-{
- int i;
-
- /* Initialize the tables */
- for (i = 0; i < NUM_BOOT_PARAM_TABLES; i++)
- initTable(&boot_params[i]);
-
- initTable (¤t_table);
-
- /* Initialize the PCI param table */
- initPciParams ();
-
- /* open the input */
- if (argc != 2) {
- fprintf (stderr, "usage: %s inputfile\n", argv[0]);
- return (-1);
- }
-
- yyin = fopen (argv[1], "r");
- if (yyin == NULL) {
- fprintf (stderr, "%s: could not open file %s\n", argv[0], argv[1]);
- return (-1);
- }
-
- /* Parse the input description file */
- yyparse();
-
-
- /* Create the output file */
- createOutput ();
-
- return (0);
-}
-
-
-
diff --git a/src/util/romparse_c6472/romparse.h b/src/util/romparse_c6472/romparse.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _ROMPARSE_H
-#define _ROMPARSE_H
-/*************************************************************************************
- * FILE PURPOSE: Define boot data structures
- *************************************************************************************
- * FILE NAME: romparse.h
- *
- * DESCRIPTION: Defines the structures used to create the boot parameter
- * table
- *
- *************************************************************************************/
-
-/* tiboot.h defines the boot parameters structure that will be created */
-#include "tiboot.h"
-
-/* Define the number of boot parameter tables that will be put on the rom */
-#define NUM_BOOT_PARAM_TABLES 8
-
-/* Define the size reserved for the PCI configuration table */
-#define PCI_EEAI_PARAM_SIZE 0x20
-
-/* Define a structure mapping the boot parameter table number to a program file
- * to an eeprom byte address */
-#define MAX_FNAME_LEN 132
-#define MAX_DATA_LEN_32bit 32768
-typedef struct {
- char fname[MAX_FNAME_LEN];
- int sizeBytes;
- int addressBytes;
- unsigned int data[MAX_DATA_LEN_32bit];
-} progFile_t;
-
-/* Define the PCI parameter structure */
-#define PCI_DATA_LEN_32bit 8
-typedef struct {
- char fname[MAX_FNAME_LEN];
- int sizeBytes;
- int addressBytes;
- unsigned int data[PCI_DATA_LEN_32bit];
-} pciFile_t;
-
-
-
-
-#endif /* ROMPARSE_H */
diff --git a/src/util/romparse_c6472/rparse.flex b/src/util/romparse_c6472/rparse.flex
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Lexical analyzer for the eeprom boot builder */
-%{
-#include "rparse.tab.h"
-%}
-%%
-
-"{" return (LBRACE);
-"}" return (RBRACE);
-"=" return (EQU);
-
-section { yylval = SECTION; return (SECTION); }
-boot_mode { yylval = BOOT_MODE; return (BOOT_MODE); }
-param_index { yylval = PARAM_INDEX; return (PARAM_INDEX); }
-options { yylval = OPTIONS; return (OPTIONS); }
-multi_i2c_id { yylval = MULTI_I2C_ID; return (MULTI_I2C_ID); }
-my_i2c_id { yylval = MY_I2C_ID; return (MY_I2C_ID); }
-core_freq_mhz { yylval = CORE_FREQ_MHZ; return (CORE_FREQ_MHZ); }
-i2c_clk_freq_khz { yylval = I2C_CLK_FREQ_KHZ; return (I2C_CLK_FREQ_KHZ); }
-exe_file { yylval = EXE_FILE; return (EXE_FILE); }
-pci_parm { yylval = PCI_PARMS; return (PCI_PARMS); }
-dev_addr_ext { yylval = DEV_ADDR_EXT; return (DEV_ADDR_EXT); }
-next_dev_addr { yylval = NEXT_DEV_ADDR; return (NEXT_DEV_ADDR); }
-next_dev_addr_ext { yylval = NEXT_DEV_ADDR_EXT; return (NEXT_DEV_ADDR_EXT); }
-address_delay { yylval = ADDRESS_DELAY; return (ADDRESS_DELAY); }
-sw_pll { yylval = SWPLL; return (SWPLL); }
-
-
-[0-9]+ { yylval = atoi(yytext); return (VALUE); }
-0x[0-9a-f]+ { sscanf (&yytext[2], "%x", &yylval); return (VALUE); }
-
-\".*\" return (STRING);
-
-[ \t]+ ;
-[\n] ;
-
-%%
-
-
-
-
diff --git a/src/util/romparse_c6472/rparse.y b/src/util/romparse_c6472/rparse.y
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Parse the parameter spec */
-%{
-#define YYERROR_VERBOSE
-extern char *yytext;
-%}
-%token LBRACE RBRACE SECTION EQU VALUE STRING BOOT_MODE PARAM_INDEX OPTIONS
-%token MULTI_I2C_ID MY_I2C_ID CORE_FREQ_MHZ I2C_CLK_FREQ_KHZ
-%token EXE_FILE PCI_PARMS NEXT_DEV_ADDR NEXT_DEV_ADDR_EXT ADDRESS_DELAY SWPLL
-%token DEV_ADDR_EXT
-%%
-
-promspec : bootParams
- | promspec bootParams
- ;
-
-bootParams : SECTION LBRACE assigns RBRACE
- { section (); }
- | PCI_PARMS EQU STRING
- { setPciParams (yytext); }
- ;
-
-
-assigns : assign
- | assigns assign
- ;
-
-assign : keyword EQU VALUE
- { assignKeyVal ($1, $3); }
- | keyword EQU STRING
- { assignKeyStr ($1, yytext); }
- ;
-
-keyword : BOOT_MODE { $$=$1; }
- | PARAM_INDEX { $$=$1; }
- | OPTIONS { $$=$1; }
- | MULTI_I2C_ID { $$=$1; }
- | MY_I2C_ID { $$=$1; }
- | CORE_FREQ_MHZ { $$=$1; }
- | I2C_CLK_FREQ_KHZ { $$=$1; }
- | EXE_FILE { $$=$1; }
- | NEXT_DEV_ADDR { $$=$1; }
- | NEXT_DEV_ADDR_EXT { $$=$1; }
- | DEV_ADDR_EXT { $$=$1; }
- | ADDRESS_DELAY { $$=$1; }
- | SWPLL { $$=$1; }
- ;
-
-%%
-
-
diff --git a/src/util/romparse_c6472/tiboot.h b/src/util/romparse_c6472/tiboot.h
+++ /dev/null
@@ -1,545 +0,0 @@
-#ifndef __TIBOOT_H__
-#define __TIBOOT_H__
-/******************************************************************************
- * FILE PURPOSE: Define Structures, MACROs and etc for TI Shared ROM Boot
- ******************************************************************************
- * FILE NAME: tiboot.h
- *
- * DESCRIPTION: Define structures, macros and etc for the TI Shared ROM boot
- * process.
- *
- * TABS: NONE
- *
- * $Id: $
- *
- * REVISION HISTORY:
- *
- * $Log: $
- *
- * (C) Copyright 2004 TELOGY Networks, Inc.
- ******************************************************************************/
-#include "types.h"
-
-/*******************************************************************************
- * Utility Macro definitions
- ******************************************************************************/
-#define HEX_DIGIT(digit) ((digit) + '0')
-#define BOOT_BIT_TO_MASK(bit) (1 << (bit))
-
-/*******************************************************************************
- * Data Definition: Error Handling relatBOOT_ENTRY_POINT_ADDRed definition:
- *******************************************************************************
- * Description: Define Handling related macros, constants
- *
- ******************************************************************************/
-/* Define Module IDs */
-#define BOOT_MODULE_ID_MAIN 0
-#define BOOT_MODULE_ID_BTBL 1
-#define BOOT_MODULE_ID_BETH 2
-#define BOOT_MODULE_ID_I2C 3
-#define BOOT_MODULE_ID_CHIP 4
-#define BOOT_MODULE_ID_HW 5
-
-/* Boot error codes */
-enum {
- BOOT_NOERR = 0,
- BOOT_ERROR = 1, /* General error */
- BOOT_INVALID_BOOT_MODE = 2,
- BOOT_INVALID_I2C_DEV_ADDR = 3,
- BOOT_INVALID_CHECKSUM = 4, /* Invalid checksum of the boot parameters */
- BOOT_INVALID_PARAMS_SIZE = 5, /* the size of boot parameters is too big */
- BOOT_RX_ETH_QUEUE_FULL = 6, /* ethmain.c, hw_rxPacket */
- BOOT_CACHE_INIT_FAIL = 7, /* rmain.c, cache init failed */
- BOOT_CACHE_DISABLE_FAIL = 8, /* rmain.c, cache disable failed */
- BOOT_INVALID_CPPI_SIZE = 9, /* ethmain.c, invalid compile sizes */
- BOOT_INVALID_CORE_ID = 10, /* Invalid core ID in cold boot */
- BOOT_INVALID_MAC_ADDR = 11, /* Invalid MAC address (all 0's) */
- BOOT_ETH_TX_SCRATCH = 12, /* tx scratch size invalid */
- BOOT_ETH_TX_PACKET = 13, /* tx packet formation failure */
- BOOT_ETH_MAC_INIT = 14, /* ethmain.c - mac init failed */
- BOOT_PERIPH_POWER = 15, /* peripheral failed to powerup */
- BOOT_MAIN_FAIL = 16 /* Failed in initial boot setup (wrong core) */
-};
-
-/* Error tracking prototypes (functions in rmain.c)*/
-void bootException (UINT16 errorCode);
-void bootError (UINT16 errorCode);
-
-/* Error code = (module ID * 100) + module specific error */
-#define BOOT_ERROR_CODE(id, code) ((UINT16)((id<<8) + code))
-#define BOOT_EXCEPTION(error_code) bootException(error_code)
-#define BOOT_ERROR(error_code) bootError(error_code)
-
-/*******************************************************************************
- * Begin Boot Parameter definitions
- ******************************************************************************/
-
-/*******************************************************************************
- * Boot Parameter Common
- ******************************************************************************/
-typedef struct boot_params_common_s{
- UINT16 length; /* size of the entire boot parameters in bytes */
- UINT16 checksum; /* non-zero: 1's complement checksum of the boot
- * parameters
- * zero: checksum is not applicable
- */
- UINT16 boot_mode;
- UINT16 portNum;
- UINT16 swPll; /* CPU PLL multiplier */
-
-
-} BOOT_PARAMS_COMMON_T;
-
-typedef struct boot_params_ethernet_s{
-
- /* common portion of the Boot parameters */
- UINT16 length;
- UINT16 checksum;
- UINT16 boot_mode;
- UINT16 portNum;
- UINT16 swPll; /* CPU PLL multiplier */
-
- /* Etherent specific portion of the Boot Parameters */
- UINT16 options;
- /*
- * Ethernet Specific Options
- *
- * Bits 2:0 interface
- * 000 - MII
- * 001 - RMII
- * 010 - GMII
- * 011 - RGMII
- * 100 - SMII
- * 101 - S3MII
- * 110 - RMII 10Mbs
- * 111 - RMII 100Mbs
- *
- * Bit 3: HD:
- * 0 - Full Duplex
- * 1 - Half Duplex
- * Bit 4: SKIP TX
- * 0 - Send the Ethernet Ready Frame
- * 1 - Skip sending the Ethernet Ready Frame
- * Bit 5: SKIP INIT
- * 0 - Initialize the Ethernet MAC peripheral
- * 1 - Skip initializing the Ethernet MAC peripheral
- * Bit 6: FC
- * 0 - Disable Flow Control
- * 1 - Enable Flow Control
- *
- * Other bits: Reserved
- */
- #define BOOT_PARAMS_ETH_OPTIONS_MII 0x0000
- #define BOOT_PARAMS_ETH_OPTIONS_RMII 0x0001
- #define BOOT_PARAMS_ETH_OPTIONS_GMII 0x0002
- #define BOOT_PARAMS_ETH_OPTIONS_RGMII 0x0003
- #define BOOT_PARAMS_ETH_OPTIONS_SMII 0x0004
- #define BOOT_PARAMS_ETH_OPTIONS_S3MII 0x0005
- #define BOOT_PARAMS_ETH_OPTIONS_RMII_10 0x0006
- #define BOOT_PARAMS_ETH_OPTIONS_RMII_100 0x0007
-
- #define BOOT_PARAMS_ETH_OPTIONS_HD 0x0008
- #define BOOT_PARAMS_ETH_OPTIONS_SKIP_TX 0x0010
- #define BOOT_PARAMS_ETH_OPTIONS_SKIP_INIT 0x0020
- #define BOOT_PARAMS_ETH_OPTIONS_FC 0x0040
-
- /*
- * he device MAC address to be used for Boot:
- * All zero mac address indicates that the device E-fuse address should
- * be used.
- */
- UINT16 mac_addr_h;
- UINT16 mac_addr_m;
- UINT16 mac_addr_l;
-
- /*
- * The multicast or broadcast MAC address which should be accepted as
- * a destination MAC address for boot table frames
- */
- UINT16 mmac_addr_h;
- UINT16 mmac_addr_m;
- UINT16 mmac_addr_l;
-
- UINT16 src_port; /* Source UDP port number to be used during boot process */
- /* 0: allow any SRC UDP port */
- UINT16 dest_port; /* Destination UDP port number to be used during boot process */
-
- /* The Device ID to be included in the boot ready announcement frame */
- UINT16 device_id_12;
- UINT16 device_id_34;
- #define BOOT_PARAMS_DEVICE_ID_HIGH_MASK 0xFF00
- #define BOOT_PARAMS_DEVICE_ID_HIGH_SHIFT 8
- #define BOOT_PARAMS_DEVICE_ID_LOW_MASK 0x00FF
- #define BOOT_PARAMS_DEVICE_ID_LOW_SHIFT 0
- #define BOOT_PARAMS_GET_DEVICE_ID_13(device_id) \
- (((device_id) & BOOT_PARAMS_DEVICE_ID_HIGH_MASK) > BOOT_PARAMS_DEVICE_ID_HIGH_SHIFT)
- #define BOOT_PARAMS_GET_DEVICE_ID_24(device_id) \
- (((device_id) & BOOT_PARAMS_DEVICE_ID_LOW_MASK) > BOOT_PARAMS_DEVICE_ID_LOW_SHIFT)
-
- /*
- * The destination MAC address used for the boot ready announce frame
- */
- UINT16 hmac_addr_h;
- UINT16 hmac_addr_m;
- UINT16 hmac_addr_l;
-
-} BOOT_PARAMS_ETHERNET_T;
-
-/**************************************************************************************
- * Utopia boot options
- **************************************************************************************/
-typedef struct boot_params_utopia_s{
-
- /* common portion of the Boot parameters */
- UINT16 length;
- UINT16 checksum;
- UINT16 boot_mode;
- UINT16 portNum;
- UINT16 swPll; /* CPU PLL multiplier */
-
- /* Utopia specific portion of the Boot Parameters */
- /* Options
- * ---------------------------------------------------------------
- * | 15 3 | 2 | 1 | 0 |
- * ----------------------------------------------------------------
- * reserved | | \-> 0 = multi phy
- * | | 1 = single phy
- * | \-> 0 = 8 bit utopia
- * | 1 = 16 bit utopis
- * \-> 0 = Init port
- * 1 = skip port init
- */
- UINT16 options;
-
- #define BOOT_PARAMS_UTOPIA_SINGLE_PHY (1<<0)
- #define BOOT_PARAMS_UTOPIA_16BIT (1<<1)
- #define BOOT_PARAMS_UTOPIA_SKIP_INIT (1<<2)
-
- UINT16 cellSizeBytes; /* Cell Size */
- UINT16 busWidthBits; /* Bus width (8 or 16) */
- UINT16 slid; /* Slave ID */
- UINT16 coreFreqMhz; /* CPU frequency after pll mult */
-
-
-} BOOT_PARAMS_UTOPIA_T;
-
-typedef struct boot_params_i2c_s{
-
- /* common portion of the Boot parameters */
- UINT16 length;
- UINT16 checksum;
- UINT16 boot_mode;
- UINT16 portNum;
- UINT16 swPll; /* CPU PLL multiplier */
-
- /* I2C specific portion of the Boot Parameters */
- UINT16 options;
- /*
- * I2C Specific Options
- * Bit 01-00: BT:
- * 00 - Boot Parameter Mode
- * 01 - Boot Table Mode
- * 10 - Boot Config mode
- * 11 - Slave receive boot config
- * Bit 04-02: EETYPE: EEPROM type
- * Other bits: Reserved
- */
- #define BOOT_PARAMS_I2C_OPTIONS_BP 0x0000
- #define BOOT_PARAMS_I2C_OPTIONS_BT 0x0001
- #define BOOT_PARAMS_I2C_OPTIONS_BC 0x0002
- #define BOOT_PARAMS_I2C_OPTIONS_SLVOPT 0x0003
-
- #define BOOT_PARAMS_I2C_OPTIONS_MASK 0x0003
- #define BOOT_PARAMS_I2C_OPTIONS_SHIFT 0
-
- #define BOOT_PARAMS_I2C_OPTIONS_EETYPE_MASK 0x001C
- #define BOOT_PARAMS_I2C_OPTIONS_EETYPE_SHIFT 2
-
- #define BOOT_PARAMS_I2C_IS_BOOTTBL_MODE(options) \
- (((options) & BOOT_PARAMS_I2C_OPTIONS_MASK) == BOOT_PARAMS_I2C_OPTIONS_BT)
-
- #define BOOT_PARAMS_I2C_IS_BOOTCONFIG_MODE(options) \
- (((options) & BOOT_PARAMS_I2C_OPTIONS_MASK) == BOOT_PARAMS_I2C_OPTIONS_BC)
-
- #define BOOT_PARAMS_I2C_IS_SLAVE_RCV_OPTIONS_MODE(options) \
- (((options) & BOOT_PARAMS_I2C_OPTIONS_MASK) == BOOT_PARAMS_I2C_OPTIONS_SLVOPT)
-
- #define BOOT_PARAMS_I2C_IS_BOOTPARAM_MODE(options) \
- (((options) & BOOT_PARAMS_I2C_OPTIONS_MASK) == BOOT_PARAMS_I2C_OPTIONS_BP)
-
- #define BOOT_PARAMS_I2C_SET_BOOTTBL_MODE(options, mode) \
- (options) = ((options) & ~BOOT_PARAMS_I2C_OPTIONS_MASK) | \
- (((mode) & BOOT_PARAMS_I2C_OPTIONS_MASK) << \
- BOOT_PARAMS_I2C_OPTIONS_SHIFT)
-
-
- #define BOOT_PARAMS_I2C_GET_EETYPE(options) \
- (((options) & BOOT_PARAMS_I2C_OPTIONS_EETYPE_MASK) >> BOOT_PARAMS_I2C_OPTIONS_EETYPE_SHIFT)
- #define BOOT_PARAMS_I2C_SET_EETYPE(options, ee_type) \
- (options) = (((options) & ~BOOT_PARAMS_I2C_OPTIONS_EETYPE_MASK) | \
- (((ee_type) << BOOT_PARAMS_I2C_OPTIONS_EETYPE_SHIFT) & BOOT_PARAMS_I2C_OPTIONS_EETYPE_MASK))
-
- /* The device address to be used for Boot */
- UINT16 dev_addr; /* 16-bit device address (low) */
- UINT16 dev_addr_ext; /* 16-bit extended device address (high)
- * set to zero if not used
- * Note: some I2C device requires 32-bit
- * address
- */
- UINT16 multi_i2c_id; /* Multi device master write boot ID */
- UINT16 my_i2c_id; /* This parts I2C address */
-
- UINT16 core_freq_mhz; /* Core frequency, MHz */
- UINT16 i2c_clk_freq_khz; /* Desired I2C clock frequency, kHz */
-
- UINT16 next_dev_addr; /* Used only for the boot config mode. */
- UINT16 next_dev_addr_ext; /* Copied into dev_addr* after config complete */
-
- UINT16 address_delay; /* Rough number of cycles delay between address write
- * and read to the i2c eeprom */
-
-
-} BOOT_PARAMS_I2C_T;
-
-
-typedef struct boot_params_rapidio_s{
-
- /* common portion of the Boot parameters */
- UINT16 length;
- UINT16 checksum;
- UINT16 boot_mode;
- UINT16 portNum;
- UINT16 swPll; /* CPU PLL multiplier */
-
- /* Options */
- UINT16 options;
-
- #define BOOT_PARAMS_RIO_OPTIONS_TX_ENABLE (1<<0) /* set to enable transmit */
- #define BOOT_PARAMS_RIO_OPTIONS_BOOT_TABLE (1<<1) /* set to use boot tables */
- #define BOOT_PARAMS_RIO_OPTIONS_NO_CONFIG (1<<2) /* set to bypass port config */
-
- UINT16 cfg_index; /* General configuration index to use */
- UINT16 node_id; /* The node id for this device */
- UINT16 serdes_ref_clk; /* The serdes reference clock freq, in hundredths
- * of MHz (1 MHz would be 100) */
- UINT16 link_rate; /* Data link rate (mega bits per second */
- UINT16 pf_low; /* Packet forward range, low */
- UINT16 pf_high; /* Packet forward range, high */
-
-} BOOT_PARAMS_RIO_T;
-
-/*
- * UNION of boot parameter structures in all modes
- * Note: We need to make sure that the structures genertaed by the C-compiler
- * match with the boot parameter table data format i.e. a set of 16-bit
- * data array.
- */
-#define BOOT_PARAMS_SIZE_IN_BYTES 128
-typedef union {
- BOOT_PARAMS_COMMON_T common;
- BOOT_PARAMS_ETHERNET_T eth;
- BOOT_PARAMS_I2C_T i2c;
- BOOT_PARAMS_UTOPIA_T utopia;
- BOOT_PARAMS_RIO_T rio;
- UINT16 parameter[BOOT_PARAMS_SIZE_IN_BYTES/2];
-} BOOT_PARAMS_T;
-
-
-/*******************************************************************************
- * Definition: The time stamp and version number are placed into the stats.
- * This will be two characters packed per 16bits . The length
- * value must be 32 bit divisible
- *******************************************************************************/
-#define BOOT_VERSION_LEN_UINT16 32
-typedef struct BOOT_VERSION_S {
-
- UINT16 vstring[BOOT_VERSION_LEN_UINT16];
-
-} BOOT_VERSION_T;
-extern BOOT_VERSION_T bootVersion;
-
-
-/*******************************************************************************
- * Definition: Runs time stats that are not initialized on cold boot entry
- * !!!!!! boot.s assumes that the nonInit stats are at the top of the structure
- * !!!!!! and that stage is the first element
- *******************************************************************************/
-typedef struct BOOT_STATS_NONINIT_S {
- UINT16 stage; /* Record the SharedROM code execution stage */
- #define BOOT_STAGE_ASM_START_UP 1
- #define BOOT_STAGE_INIT_CACHE 2
- #define BOOT_STAGE_CHCHE_INITED 3
- #define BOOT_STAGE_ENTER_WARMBOOT 4
- #define BOOT_STAGE_INIT_CPGMAC 5
- #define BOOT_STAGE_SEND_ERA_FRAME 6
- #define BOOT_STAGE_ETH_MAIN_LOOP 7
- #define BOOT_STAGE_I2C_BOOTTBL_LOOP 8
- #define BOOT_STAGE_I2C_BOOTPARAM_LOOP 9
- #define BOOT_STAGE_DISABLE_CACHE 10
- #define BOOT_STAGE_CHCHE_DISABLED 11
- #define BOOT_STAGE_EXIT 12
- #define BOOT_STAGE_ERROR_LOOP 13
- #define BOOT_STAGE_I2C_BOOTCONFIG_LOOP 14
- #define BOOT_STAGE_I2C_SLV_RCV_OPTIONS_LOOP 15
- #define BOOT_STAGE_UTOPIA_MAIN_LOOP 16
- UINT16 coldBootEntries;
-
-} BOOT_STATS_NONINIT_T;
-
-/*******************************************************************************
- * Definition: Run time statistics and error counts. These stats are
- * initialized on cold boot entry.
- ******************************************************************************/
-
-typedef struct BOOT_STATS_COMMON_S {
- UINT32 bootStatus;
- UINT16 nColdBootEntries;
- UINT16 nBootReentries;
- UINT16 nPllWarns;
- UINT16 nResetWarns;
-} BOOT_STATS_COMMON_T;
-
-
-typedef struct BOOT_STATS_MAIN_S {
- UINT16 errorCode; /* (module ID <<8 ) + module specific error */
-
- /* I2C operation related statistics */
- UINT16 numI2Cpkts; /* number of I2C boot table packets processed */
- UINT16 numI2CchksumError;/* number of I2C checksum errors */
- UINT16 numI2ClengthError;/* number of I2C block length errors */
- UINT16 numI2CotherError; /* number of I2C section with invalid length and etc */
- UINT16 numI2Cretrys; /* number of I2C retrys due to read access errors */
- UINT16 numI2cWrites; /* number of I2C master writes to passive devices */
- UINT16 numI2cWriteError; /* number of I2C master write errors */
-
- UINT16 warmBootEntry; /* Count of entries into warm boot routine */
-} BOOT_STATS_MAIN_T;
-
-
-
-/*****************************************************************************
- * Definition: I2C stats, Boot table and Ethernrt stats initialized
- * on cold boot entry
- *****************************************************************************/
-typedef struct I2C_STATS_tag
-{
- UINT16 num_trans;
- UINT16 num_trys;
- UINT16 num_try_ok;
- UINT16 num_try_lost_arb;
- UINT16 num_try_idle_to;
- UINT16 num_try_no_ack;
- UINT16 num_try_other_err;
- UINT32 extra_idle_waits;
- UINT32 extra_clock_waits;
- UINT32 tx_bytes;
- UINT32 rx_bytes;
- UINT32 data_re_reads;
-} I2C_STATS_T;
-
-typedef struct BTBL_STATS_tag
-{
- UINT16 num_sections; /* number of boot table sections received */
- UINT16 num_pdma_copies; /* number of PDMA copies performed */
-} BTBL_STATS_T;
-
-typedef struct ETH_STATS_tag
-{
- /* MAC packets related statistics */
- UINT16 uniMacPkts; /* Count of packets received with valid unicast mac
- address */
- UINT16 multiMacPkts; /* Count of packets received with valid multicast or
- broadcast mac address */
- UINT16 invalidMacPkts; /* Count of packets received with invalid mac
- address */
- UINT16 invalidLLCPkts; /* Count of 802.3 packets with wrong LLC/SNAP header */
- UINT16 nonIpPkts; /* Count of non-IP packets received with valid
- MAC address */
-
- /* IP packets related statistics */
- UINT16 nonIP4Pkts; /* Count of non-IP4 packets */
- UINT16 ipfragments; /* Count of IP fragments received */
- UINT16 ipTruncatedError; /* Count of truncated IP frame */
- UINT16 nonUDPPkts; /* Count of IP packets with non-UDP paylaod */
-
- /* UDP packets related statistics */
- UINT16 udpSizeError; /* Count of UDP packet with invalid (odd) size */
- UINT16 udpPortError; /* Count of UDP packets with invalid port number */
- UINT16 udpChksumError; /* Count of UDP packets with checksum error */
-
- /* Boot table packets related statistics */
- UINT16 nonBtblPkts; /* Count of UDP packets with invalid boot table paylaod */
- UINT16 outSeqPkts; /* Count of out of sequence boot table packets received
- i.e. packets with unexpected seq_num */
- UINT16 expSeqNum; /* Expected Sequence Number */
- UINT16 lastSeqNum; /* Last sequence number received */
-
- /* Driver errors */
- UINT16 sizeZeroPackets; /* Count of packets arriving with 0 size */
-} ETH_STATS_T;
-
-typedef struct PCI_EEAI_STATS_tag
-{
- UINT16 pciI2cReads; /* Count of block reads of i2c eeprom */
- UINT16 pciI2cRetries; /* Count of i2c read retries */
- UINT16 pciChkSumErr; /* Count of block check sum errors */
- UINT16 pciEeaiFail; /* Count of aborted pci attempts */
-} PCI_EEAI_STATS_T;
-
-/* Rapid I/O stats */
-typedef struct RAPIDIO_STATS_tag
-{
- UINT16 rapidIoFailReady; /* If set rapid I/O peripheral failed to report ready */
- UINT16 rapidIoBtblBlocks; /* Count of number of boot table blocks received */
- UINT16 rapidIoBtblBadBlocks; /* Count of boot table blocks rejected */
-} RAPIDIO_STATS_T;
-
-typedef struct HPI_STATS_Tag
-{
- UINT16 hpiBtblBlocks; /* Count of boot table blocks received */
- UINT16 hpiBtblBadBlocks; /* Count of boot table blocks rejected */
-} HPI_STATS_T;
-
-/* Utopia stats */
-typedef struct UTOPIA_STATS_tag
-{
- UINT16 cellCount; /* Count of cells received */
- UINT16 invalidPtr; /* Count of invalid pointers received in processing */
- UINT16 invalidSize; /* Count of cells that were too small */
- UINT16 cellMagicCount; /* Count of cells received with valid magic */
- UINT16 cellMagicFailed; /* Count of cells received with invalid magic */
- UINT16 trapNoCellMem; /* Trapped due to no cell space in memory */
- UINT16 possibleOverrun; /* Count of possible cell buffer overruns */
-} UTOPIA_STATS_T;
-
-/*******************************************************************************
- * Definition: The statistics
- *
- * !!!!!! boot.s assumes that the nonInit stats are at the top of the structure!
- *******************************************************************************/
-typedef struct BOOT_STATS_S {
-
- BOOT_STATS_COMMON_T common;
- BOOT_STATS_NONINIT_T nonInit;
- BOOT_STATS_MAIN_T main;
- I2C_STATS_T i2c;
- BTBL_STATS_T btbl;
- union {
- ETH_STATS_T eth;
- PCI_EEAI_STATS_T pci_eeai;
- RAPIDIO_STATS_T rapidIo;
- UTOPIA_STATS_T utopia;
- HPI_STATS_T hpi;
- } u;
-} BOOT_STATS_T;
-
-extern BOOT_STATS_T bootStats;
-
-/*******************************************************************************
- * Definition: The magic start address, known to all modules
- *******************************************************************************/
-extern volatile UINT32 *p_boot_entry_addr;
-
-#endif /* __TIBOOT_H__ */
-
-/* nothing past this point */
diff --git a/src/util/romparse_c6472/types.h b/src/util/romparse_c6472/types.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _TYPES_H
-#define _TYPES_H
-/**************************************************************************
- * FILE PURPOSE: Define type values
- **************************************************************************
- * FILE NAME: types.h
- *
- * DESCRIPTION: File required to read the tiboot.h file directly from
- * the application.
- *
- ***************************************************************************/
-
-typedef unsigned int UINT16;
-typedef unsigned int UINT32;
-typedef unsigned int word;
-
-
-
-
-#endif /* _TYPES_H */
\ No newline at end of file