summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b38bff4)
raw | patch | inline | side by side (parent: b38bff4)
author | Mike Line <m-line1@ti.com> | |
Fri, 1 Oct 2010 17:59:36 +0000 (13:59 -0400) | ||
committer | Mike Line <m-line1@ti.com> | |
Fri, 1 Oct 2010 17:59:36 +0000 (13:59 -0400) |
The makefile and tools are updated to so the i2c bus address used
by the ibl will be 0x50 by default for the little endian image,
and 0x51 for the big endian. These can be overridden in the
make command.
by the ibl will be 0x50 by default for the little endian image,
and 0x51 for the big endian. These can be overridden in the
make command.
27 files changed:
diff --git a/src/cfg/c6472/iblcfg.h b/src/cfg/c6472/iblcfg.h
index 7580315e4b2cfe3961dd4f070fe1cb7261f1f9da..d0f8e7c7b6eea7a1732b92ffbf381444ad03edbd 100644 (file)
--- a/src/cfg/c6472/iblcfg.h
+++ b/src/cfg/c6472/iblcfg.h
#define IBL_I2C_CLK_FREQ_KHZ 100
#define IBL_I2C_OWN_ADDR 10
#define IBL_I2C_CFG_ADDR_DELAY 0x100 /* Delay between sending the address and reading data */
-#define IBL_I2C_CFG_EEPROM_BUS_ADDR 0x50
+
+#ifndef IBL_I2C_CFG_EEPROM_BUS_ADDR
+ #error hello
+ #define IBL_I2C_CFG_EEPROM_BUS_ADDR 0x50
+#endif
+
#define IBL_I2C_CFG_TABLE_DATA_ADDR (0x10000 - 0x300)
index c7d482a89781154d56e6d6ea93323abb193fea00..5dfd801bb11a7bb0ed615b07bc53a377a38d167d 100644 (file)
gen_cdefdep:
- @echo CSRC= $(CSRC)
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) $(ARCH) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(ARCH) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 51c96b39a2c0f4a9b5215b0850aa06053c90ed9a..3d8bb70a4f03299bbb44c8a0ce63840796afc995 100644 (file)
CSRC= $(ETHSRC) $(STRMSRC) $(TIMSRC) $(NANDSRC)
+
+CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
+
.PHONY: driver
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 8d636712e979d286262e70568effa373156bb9df..47847bfca232f218b2ab7e970a9065c32d17df22 100644 (file)
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 1f6e964d2a61f4dfe5410bbd47757ee699fda3f4..2e27527350000ea62e2ca2b1a24cd532fe5d8dee 100644 (file)
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 14b3da920b0405d575b6bff33a41b5a8ef3115d6..a09110b1170ca9b8e8d868740bd7c44a7f3afcc5 100644 (file)
CSRC= t64.c cpmacdrv.c pll.c psc.c emif31.c mdio.c gpio.c nandgpio.c i2c.c nandwrgpio.c
endif
+CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
.PHONY: hw
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) $(ARCH) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(ARCH) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 2cfead40a5eb8c428d9564507ce591571a318a55..273366e81442d4e6612d83037294700fadbbb300 100644 (file)
# elf loader files
CSRC += dload.c elfwrap.c dlw_client.c dload_endian.c ArrayList.c
+CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
.PHONY: interp
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) $(ARCH) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(ARCH) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
diff --git a/src/interp/elf/dload.c b/src/interp/elf/dload.c
index cf7ddf3fdab1d0679628e369beb04a808b42d8ac..6bf08e0228eca360d57b24e66456f3f47a0a7af9 100644 (file)
--- a/src/interp/elf/dload.c
+++ b/src/interp/elf/dload.c
#include "dload.h"
#include "dload_api.h"
+/* Eat printfs. */
+#define printf mprintf
+
+
+
#if 0
#include "ArrayList.h"
/* The core loader must have read access to the file pointed to by fd. */
/* */
/*****************************************************************************/
-int32_t DLOAD_load(LOADER_FILE_DESC *fd, int argc, char** argv, uint32_t *entry)
+int32_t DLOAD_load(LOADER_FILE_DESC *fd, int argc, char** argv, int32_t *entry)
{
DLIMP_Dynamic_Module *dyn_module = new_DLIMP_Dynamic_Module(fd);
@@ -2406,9 +2411,9 @@ int32_t DLOAD_load(LOADER_FILE_DESC *fd, int argc, char** argv, uint32_t *entry)
/* Support static loading as special case. */
/*------------------------------------------------------------------------*/
if (!dyn_module->relocatable) {
- dload_static_executable(fd, dyn_module);
+ return (dload_static_executable(fd, dyn_module));
*entry = dyn_module->fhdr.e_entry;
- return (0);
+ return (0);
}
#if 0
index 9d74206a7a4ff8493dc635b970588f8cd8e167f1..ee809517f1d8973a43d07510a3687e1fb870e94c 100644 (file)
/* The core loader must have read access to the file pointed by fp. */
/* */
/*---------------------------------------------------------------------------*/
-int DLOAD_load(LOADER_FILE_DESC* fp, int argc, char** argv, uint32_t *entry);
+int DLOAD_load(LOADER_FILE_DESC* fp, int argc, char** argv, int32_t *entry);
/*---------------------------------------------------------------------------*/
/* DLOAD_unload() */
index 0d57829bb7547a081a3afae2254bb33bf15948cf..cd7985424995f3e956fbd9c77a8a29e63b779c16 100644 (file)
#include <string.h>
#include "file_ovr.h"
+/* Eat printfs. */
+#define printf mprintf
+#define vprintf(x,y)
+
#if 0
#include "dlw_debug.h"
#include "dlw_dsbt.h"
index d2e8290524bfcd759951f06514ae15dfccf24ce7..2b41b45f20dc390cc155858a463a4f317af1c1de 100644 (file)
--- a/src/interp/elf/elfwrap.c
+++ b/src/interp/elf/elfwrap.c
#include "ibl_elf.h"
#include "file_ovr.h"
+/**
+ * @brief
+ * Required for the dload module
+ */
BOOL DLL_debug = FALSE;
/**
{
int argc;
char **argv;
+ int32_t dloadHandle;
+
+ dloadHandle = DLOAD_load (bootFxn, argc, argv, ientry_point);
+
+}
+
+/**
+ * @brief
+ * Look for the elf signature in the 1st 4 bytes of a data file
+ */
+BOOL iblIsElf (Uint8 *elfhdr)
+{
+ if ( (elfhdr[0] == 0x7f) &&
+ (elfhdr[1] == 'E') &&
+ (elfhdr[2] == 'L') &&
+ (elfhdr[3] == 'F') )
+ return (TRUE);
- DLOAD_load (bootFxn, argc, argv, ientry_point);
+ return (FALSE);
}
+
+
+
index 5c02c2a4af76f0e52d09df1a05d0bef1ed34676a..c5498ce388d8472194529425232d9db7fe43567a 100644 (file)
--- a/src/interp/elf/ibl_elf.h
+++ b/src/interp/elf/ibl_elf.h
void iblBootElf (BOOT_MODULE_FXN_TABLE *bootFxn, Uint32 *ientry_point);
+BOOL iblIsElf (Uint8 *elfhdr);
#endif /* _IBL_ELF_H */
index 50cc403f3a1ebe3b7718559cb5e0f700927b9dbc..ab5e54d1300d0cfff16192306f6382f337eada4c 100644 (file)
CSRC= iblmain.c
+CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
+
+
.PHONY: main
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
diff --git a/src/main/iblmain.c b/src/main/iblmain.c
index c0fb4ce3c08230ca8bc3f400a5c7c28f27f73934..36a2f7ecc7dd6c25ae5a6695d842a3531f53e485 100644 (file)
--- a/src/main/iblmain.c
+++ b/src/main/iblmain.c
@@ -222,6 +222,9 @@ Uint32 iblBoot (BOOT_MODULE_FXN_TABLE *bootFxn, Int32 dataFormat, void *formatPa
if (iblIsCoff (fid.coffVer))
dataFormat = ibl_BOOT_FORMAT_COFF;
+ if (iblIsElf (fid.dataBuf))
+ dataFormat = ibl_BOOT_FORMAT_ELF;
+
else {
iblStatus.autoDetectFailCnt += 1;
return (0);
diff --git a/src/make/Makefile b/src/make/Makefile
index be336eb22d8051400436f2a61ae078552090af4d..e3101fab0a1d6491985ba986d7e70db3a16a3220 100644 (file)
--- a/src/make/Makefile
+++ b/src/make/Makefile
endif
export ENDIAN
+# The value of I2C_PARAM_BUS_ADDR determines the I2C bus address used
+# to read the ibl configuration table from. The default values are
+# 0x50 for little endian and 0x51 for big endian
+
+ifndef I2C_PARAM_BUS_ADDR
+ ifeq ($(ENDIAN),little)
+ I2C_PARAM_BUS_ADDR=0x50
+ else
+ I2C_PARAM_BUS_ADDR=0x51
+ endif
+endif
+
+export I2C_PARAM_BUS_ADDR
+
$(IBLS_C6X):
make -f makestg2 ARCH=c64x TARGET=$@ $@
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
diff --git a/src/make/ibl_c6472/i2crom.map b/src/make/ibl_c6472/i2crom.map
+++ /dev/null
@@ -1,16 +0,0 @@
-section
-{
- param_index = 0
- boot_mode = 257
- sw_pll = 25
- options = 1
-
- core_freq_mhz = 625
- i2c_clk_freq_khz = 50
-
- multi_i2c_id = 0
- my_i2c_id = 1
- address_delay = 0
- exe_file = "ibl_c6472/ibl.i2c.ccs"
-}
-
index d988274e3e4e3a0501f8b139719b7a8112a8a323..41c1b878b19e81839a5a112e66fb55759b471a1a 100644 (file)
ROMS
{
- ROM1: org = 0x0400, length = 0x10000, memwidth = 32, romwidth = 32
+ ROM1: org = 0x0400, length = 0x20000, memwidth = 32, romwidth = 32
files = { ibl_le.b }
}
diff --git a/src/make/makestg2 b/src/make/makestg2
index 621996cce0d6e2b0c05662edf744e2f082f9afe7..7f56ff30f1c9838979272f8473e3b1df3914c892 100644 (file)
--- a/src/make/makestg2
+++ b/src/make/makestg2
ifeq ($(ENDIAN),little)
HEX_OPT= -order L
- BCV_OPT= -le
+ IEXT= le
else
HEX_OPT= -order M
- BCV_OPT= -be
+ IEXT= be
endif
include $(IBL_ROOT)/make/$(ARCH)/makedefs.mk
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)
c6472: $(MODULES) utils
$(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 $(BCV_OPT) ibl_le.b ibl.b
+ ../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.map
- $(CP) i2crom.ccs ibl_$@
- $(RM) i2crom.ccs ibl.b
+ ../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
$(MODULES):
index 06552db955a85c19a5c217b604fea5bb9856e950..2f36e1187fd7ad449ab2cf1e80d92d183c4c0a12 100644 (file)
gen_cdefdep:
@echo Checking command line dependencies
- @echo $(ENDIAN) $(TARGET) > cdefdep.tmp
+ @echo $(ENDIAN) $(TARGET) $(CDEFS) > cdefdep.tmp
@sh -c 'if diff -q cdefdep.tmp cdefdep ; then echo same ; else $(CP) cdefdep.tmp cdefdep ; fi '
index 24a1351aee53002fb273877fbf31f7db7a794c3b..22d81ca2045ad7b27eaaaab6bd733be09c648457 100644 (file)
--- a/src/util/btoccs/b2ccs.c
+++ b/src/util/btoccs/b2ccs.c
-#define SIZE 0x100000 /* max array size */
+#define SIZE 0x200000 /* max array size */
int main (int argc, char *argv[])
{
index 2d262f3ab98224a024d5260d3f0d760b8cc1c9bc..c1d6bfb3ec1e714d2d7dbe2fa54069c64a4d1d5a 100644 (file)
--- a/src/util/btoccs/b2i2c.c
+++ b/src/util/btoccs/b2i2c.c
}
-#define SIZE 0x10000 /* max array size */
+#define SIZE 0x20000 /* max array size */
int main (int argc, char *argv[])
{
index cf226b2099e7972eb6b59680866d5240c7e146c4..c8199ab1cabf39ddbb352befc700aeb77fa44af8 100644 (file)
export ENDIAN
+# The value of I2C_PARAM_BUS_ADDR determines the I2C bus address used
+# to read the ibl configuration table from. The default values are
+# 0x50 for little endian and 0x51 for big endian
+
+ifndef I2C_PARAM_BUS_ADDR
+ ifeq ($(ENDIAN),little)
+ I2C_PARAM_BUS_ADDR=0x50
+ else
+ I2C_PARAM_BUS_ADDR=0x51
+ endif
+endif
+
+export I2C_PARAM_BUS_ADDR
+
$(DEVICES):
make -f makestg2 ARCH=c64x TARGET=$@ $@
index f732af53ccfb1ee509e20c9581436495ff09609a..e240d7b807b27eebfe0b516048c0d7093b7ddbd5 100644 (file)
export ARCH
export TARGET
+CDEFS += -DIBL_I2C_CFG_EEPROM_BUS_ADDR=$(I2C_PARAM_BUS_ADDR)
.PHONY: i2cparam.cmd
index 59459ae60ff98997033bf815e2e443607a42d388..02f16bbd0be29e93f429921b5e105f61041621f3 100644 (file)
case SWPLL: current_table.i2c.swPll = value;
break;
+ case DEV_ADDR_EXT: current_table.i2c.dev_addr_ext = value;
+ break;
+
}
if (!strcmp (z, progFile[i].fname)) {
/* Found a match - copy the address */
current_table.i2c.dev_addr = progFile[i].addressBytes & 0xffff;
- current_table.i2c.dev_addr_ext = 0x50; /* hard coded to i2c rom slave address */
+ if (current_table.i2c.dev_addr_ext == 0)
+ current_table.i2c.dev_addr_ext = 0x50; /* hard coded to i2c rom slave address */
return;
}
i = openProgFile (z);
if (i >= 0) {
current_table.i2c.dev_addr = progFile[i].addressBytes & 0xffff;
- current_table.i2c.dev_addr_ext = 0x50;
+ if (current_table.i2c.dev_addr_ext == 0)
+ current_table.i2c.dev_addr_ext = 0x50;
}
} /* assignKeyStr */
index ff538115014f2a5e9b3554ce9f3f73bd316de05b..67e02db500a529958f700e3c5cf8814072830720 100644 (file)
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); }
index 20b6fafa8e760697ebb7d4a4ab000ae3e88576f6..3109b3d97eb5dc2680022d6f6d42340c955529e2 100644 (file)
%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
| EXE_FILE { $$=$1; }
| NEXT_DEV_ADDR { $$=$1; }
| NEXT_DEV_ADDR_EXT { $$=$1; }
+ | DEV_ADDR_EXT { $$=$1; }
| ADDRESS_DELAY { $$=$1; }
| SWPLL { $$=$1; }
;