summaryrefslogtreecommitdiff
path: root/cpu/ixp/npe
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-01-23 14:40:34 +0100
committerWolfgang Denk <wd@denx.de>2008-01-23 14:40:34 +0100
commit060193e4c373e08fa7fecacbd678c4e1e90e50c7 (patch)
tree27ac365ab636c36e897b652c13572d701764534d /cpu/ixp/npe
parentf10d7b94548a788a40b08a50dcdc3209427fec38 (diff)
parent40dcd6aa75ef95b490f342695f970910b82e392e (diff)
downloadu-boot-imx-060193e4c373e08fa7fecacbd678c4e1e90e50c7.zip
u-boot-imx-060193e4c373e08fa7fecacbd678c4e1e90e50c7.tar.gz
u-boot-imx-060193e4c373e08fa7fecacbd678c4e1e90e50c7.tar.bz2
Merge ../custodians
Diffstat (limited to 'cpu/ixp/npe')
-rw-r--r--cpu/ixp/npe/IxNpeDl.c32
-rw-r--r--cpu/ixp/npe/IxNpeDlImageMgr.c37
-rw-r--r--cpu/ixp/npe/Makefile4
3 files changed, 28 insertions, 45 deletions
diff --git a/cpu/ixp/npe/IxNpeDl.c b/cpu/ixp/npe/IxNpeDl.c
index ffe355c..3738337 100644
--- a/cpu/ixp/npe/IxNpeDl.c
+++ b/cpu/ixp/npe/IxNpeDl.c
@@ -109,38 +109,6 @@ PRIVATE IX_STATUS
ixNpeDlNpeInitAndStartInternal (UINT32 *imageLibrary, UINT32 imageId);
/*
- * Function definition: ixNpeDlMicrocodeImageLibraryOverride
- */
-PUBLIC IX_STATUS
-ixNpeDlMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary)
-{
- IX_STATUS status = IX_SUCCESS;
-
- IX_NPEDL_TRACE0 (IX_NPEDL_FN_ENTRY_EXIT,
- "Entering ixNpeDlMicrocodeImageLibraryOverride\n");
-
- if (clientImageLibrary == NULL)
- {
- status = IX_NPEDL_PARAM_ERR;
- IX_NPEDL_ERROR_REPORT ("ixNpeDlMicrocodeImageLibraryOverride - "
- "invalid parameter\n");
- }
- else
- {
- status = ixNpeDlImageMgrMicrocodeImageLibraryOverride (clientImageLibrary);
- if (status != IX_SUCCESS)
- {
- status = IX_FAIL;
- }
- } /* end of if-else(clientImageLibrary) */
-
- IX_NPEDL_TRACE1 (IX_NPEDL_FN_ENTRY_EXIT,
- "Exiting ixNpeDlMicrocodeImageLibraryOverride : "
- "status = %d\n", status);
- return status;
-}
-
-/*
* Function definition: ixNpeDlImageDownload
*/
PUBLIC IX_STATUS
diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c
index e05c228..75b42f2 100644
--- a/cpu/ixp/npe/IxNpeDlImageMgr.c
+++ b/cpu/ixp/npe/IxNpeDlImageMgr.c
@@ -134,12 +134,20 @@ typedef struct
static IxNpeDlImageMgrStats ixNpeDlImageMgrStats;
/* default image */
-#ifdef IX_NPEDL_READ_MICROCODE_FROM_FILE
-static UINT32 *IxNpeMicroCodeImageLibrary = NULL; /* Gets set to proper value at runtime */
+#ifdef CONFIG_IXP4XX_NPE_EXT_UCODE_BASE
+static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCODE_BASE;
#else
static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array;
#endif
+static UINT32* getIxNpeMicroCodeImageLibrary(void)
+{
+ char *s;
+ if ((s = getenv("npe_ucode")) != NULL)
+ return (UINT32*) simple_strtoul(s, NULL, 16);
+ else
+ return IxNpeMicroCodeImageLibrary;
+}
/*
* static function prototypes.
@@ -158,6 +166,7 @@ PRIVATE BOOL
ixNpeDlImageMgrNpeFunctionIdCompare (IxNpeDlImageId *imageIdA,
IxNpeDlImageId *imageIdB);
+#if 0
PRIVATE IX_STATUS
ixNpeDlImageMgrImageFind_legacy (UINT32 *imageLibrary,
UINT32 imageId,
@@ -195,7 +204,7 @@ ixNpeDlImageMgrMicrocodeImageLibraryOverride (
status);
return status;
}
-
+#endif
/*
* Function definition: ixNpeDlImageMgrImageListExtract
@@ -217,9 +226,9 @@ ixNpeDlImageMgrImageListExtract (
IX_NPEDL_TRACE0 (IX_NPEDL_FN_ENTRY_EXIT,
"Entering ixNpeDlImageMgrImageListExtract\n");
- header = (IxNpeDlImageMgrImageLibraryHeader *) IxNpeMicroCodeImageLibrary;
+ header = (IxNpeDlImageMgrImageLibraryHeader *) getIxNpeMicroCodeImageLibrary();
- if (ixNpeDlImageMgrSignatureCheck (IxNpeMicroCodeImageLibrary))
+ if (ixNpeDlImageMgrSignatureCheck (getIxNpeMicroCodeImageLibrary()))
{
/* for each image entry in the image header ... */
while (header->entry[imageCount].eohMarker !=
@@ -290,9 +299,9 @@ ixNpeDlImageMgrImageLocate (
IX_NPEDL_TRACE0 (IX_NPEDL_FN_ENTRY_EXIT,
"Entering ixNpeDlImageMgrImageLocate\n");
- header = (IxNpeDlImageMgrImageLibraryHeader *) IxNpeMicroCodeImageLibrary;
+ header = (IxNpeDlImageMgrImageLibraryHeader *) getIxNpeMicroCodeImageLibrary();
- if (ixNpeDlImageMgrSignatureCheck (IxNpeMicroCodeImageLibrary))
+ if (ixNpeDlImageMgrSignatureCheck (getIxNpeMicroCodeImageLibrary()))
{
/* for each image entry in the image library header ... */
while (header->entry[imageCount].eohMarker !=
@@ -307,8 +316,9 @@ ixNpeDlImageMgrImageLocate (
* get pointer to the image in the image library using offset from
* 1st word in image library
*/
+ UINT32 *tmp=getIxNpeMicroCodeImageLibrary();
imageOffset = header->entry[imageCount].image.offset;
- *imagePtr = &IxNpeMicroCodeImageLibrary[imageOffset];
+ *imagePtr = &tmp[imageOffset];
/* get the image size */
*imageSize = header->entry[imageCount].image.size;
status = IX_SUCCESS;
@@ -353,9 +363,9 @@ ixNpeDlImageMgrLatestImageExtract (IxNpeDlImageId *imageId)
IX_NPEDL_TRACE0 (IX_NPEDL_FN_ENTRY_EXIT,
"Entering ixNpeDlImageMgrLatestImageExtract\n");
- header = (IxNpeDlImageMgrImageLibraryHeader *) IxNpeMicroCodeImageLibrary;
+ header = (IxNpeDlImageMgrImageLibraryHeader *) getIxNpeMicroCodeImageLibrary();
- if (ixNpeDlImageMgrSignatureCheck (IxNpeMicroCodeImageLibrary))
+ if (ixNpeDlImageMgrSignatureCheck (getIxNpeMicroCodeImageLibrary()))
{
/* for each image entry in the image library header ... */
while (header->entry[imageCount].eohMarker !=
@@ -527,6 +537,7 @@ ixNpeDlImageMgrStatsReset (void)
}
+#if 0
/*
* Function definition: ixNpeDlImageMgrImageFind_legacy
*
@@ -600,7 +611,7 @@ ixNpeDlImageMgrImageFind_legacy (
"Exiting ixNpeDlImageMgrImageFind: status = %d\n", status);
return status;
}
-
+#endif
/*
* Function definition: ixNpeDlImageMgrImageFind
@@ -631,10 +642,11 @@ ixNpeDlImageMgrImageFind (
imageLibrary = ixNpeMicrocode_binaryArray;
}
#else
- imageLibrary = IxNpeMicroCodeImageLibrary;
+ imageLibrary = getIxNpeMicroCodeImageLibrary();
#endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */
}
+#if 0
/* For backward's compatibility with previous image format */
if (ixNpeDlImageMgrSignatureCheck(imageLibrary))
{
@@ -643,6 +655,7 @@ ixNpeDlImageMgrImageFind (
imagePtr,
imageSize);
}
+#endif
while (*(imageLibrary+offset) == NPE_IMAGE_MARKER)
{
diff --git a/cpu/ixp/npe/Makefile b/cpu/ixp/npe/Makefile
index 7f020b5..25117d7 100644
--- a/cpu/ixp/npe/Makefile
+++ b/cpu/ixp/npe/Makefile
@@ -72,7 +72,6 @@ COBJS := npe.o \
IxNpeDlImageMgr.o \
IxNpeDlNpeMgr.o \
IxNpeDlNpeMgrUtils.o \
- IxNpeMicrocode.o \
IxNpeMh.o \
IxNpeMhConfig.o \
IxNpeMhReceive.o \
@@ -80,6 +79,9 @@ COBJS := npe.o \
IxNpeMhSolicitedCbMgr.o \
IxNpeMhUnsolicitedCbMgr.o
+ifndef CONFIG_IXP4XX_NPE_EXT_UCODE_BASE
+COBJS += IxNpeMicrocode.o
+endif
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))