[U-Boot-Users] PATCH: load ixp42x NPE firmware from separate flash block, remove dead code

Hi,
the following patch adds support to move the IXP42X NPE firmware to a separate flash block, whose start address is defined in CONFIG_IXP4XX_NPE_EXT_UCODE_BASE. Using that, it is possible to build NPE-enabled u-boot without copyright problems due to the NPE firmware.
I have also removed some unused code (#if 0 currently - should we completely remove those unused parts?)
I hope the patch applies, I get whitespace-related differences in the NPE files due to trailing whitespace in the original versions.
Signed-off-by: Michael Schwingen michael@schwingen.org
diff --git a/cpu/ixp/npe/IxNpeDl.c b/cpu/ixp/npe/IxNpeDl.c index ffe355c..572f314 100644 --- a/cpu/ixp/npe/IxNpeDl.c +++ b/cpu/ixp/npe/IxNpeDl.c @@ -108,6 +108,7 @@ static BOOL ixNpeDlNpeStarted[IX_NPEDL_NPEID_MAX] ={FALSE, FALSE, FALSE} ; PRIVATE IX_STATUS ixNpeDlNpeInitAndStartInternal (UINT32 *imageLibrary, UINT32 imageId);
+#if 0 /* * Function definition: ixNpeDlMicrocodeImageLibraryOverride */ @@ -139,6 +140,7 @@ ixNpeDlMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary) "status = %d\n", status); return status; } +#endif
/* * Function definition: ixNpeDlImageDownload diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index e05c228..069b505 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -134,8 +134,8 @@ 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 @@ -158,6 +158,7 @@ PRIVATE BOOL ixNpeDlImageMgrNpeFunctionIdCompare (IxNpeDlImageId *imageIdA, IxNpeDlImageId *imageIdB);
+#if 0 PRIVATE IX_STATUS ixNpeDlImageMgrImageFind_legacy (UINT32 *imageLibrary, UINT32 imageId, @@ -195,7 +196,7 @@ ixNpeDlImageMgrMicrocodeImageLibraryOverride ( status); return status; } - +#endif
/* * Function definition: ixNpeDlImageMgrImageListExtract @@ -527,6 +528,7 @@ ixNpeDlImageMgrStatsReset (void) }
+#if 0 /* * Function definition: ixNpeDlImageMgrImageFind_legacy * @@ -600,7 +602,7 @@ ixNpeDlImageMgrImageFind_legacy ( "Exiting ixNpeDlImageMgrImageFind: status = %d\n", status); return status; } - +#endif
/* * Function definition: ixNpeDlImageMgrImageFind @@ -635,6 +637,7 @@ ixNpeDlImageMgrImageFind ( #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ }
+#if 0 /* For backward's compatibility with previous image format */ if (ixNpeDlImageMgrSignatureCheck(imageLibrary)) { @@ -643,6 +646,7 @@ ixNpeDlImageMgrImageFind ( imagePtr, imageSize); } +#endif
while (*(imageLibrary+offset) == NPE_IMAGE_MARKER) {

In message 20071110154411.GA11163@discworld.dascon.de you wrote:
the following patch adds support to move the IXP42X NPE firmware to a separate flash block, whose start address is defined in CONFIG_IXP4XX_NPE_EXT_UCODE_BASE. Using that, it is possible to build NPE-enabled u-boot without copyright problems due to the NPE firmware.
I have also removed some unused code (#if 0 currently - should we completely remove those unused parts?)
I hope the patch applies, I get whitespace-related differences in the NPE files due to trailing whitespace in the original versions.
Signed-off-by: Michael Schwingen michael@schwingen.org
I appreciate this patch, yet I have to NAK it in it's current form.
diff --git a/cpu/ixp/npe/IxNpeDl.c b/cpu/ixp/npe/IxNpeDl.c index ffe355c..572f314 100644 --- a/cpu/ixp/npe/IxNpeDl.c +++ b/cpu/ixp/npe/IxNpeDl.c @@ -108,6 +108,7 @@ static BOOL ixNpeDlNpeStarted[IX_NPEDL_NPEID_MAX] ={FALSE, FALSE, FALSE} ; PRIVATE IX_STATUS ixNpeDlNpeInitAndStartInternal (UINT32 *imageLibrary, UINT32 imageId);
+#if 0 /*
- Function definition: ixNpeDlMicrocodeImageLibraryOverride
*/ @@ -139,6 +140,7 @@ ixNpeDlMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary) "status = %d\n", status); return status; } +#endif
...
+#if 0
...
+#endif
etc.
Please don't do this - instead, remove the dead code.
We have a source code management system to track such changes.
Best regards,
Wolfgang Denk

From: Michael Schwingen michael@schwingen.org
Hi,
the following patch adds support to move the IXP42X NPE firmware to a separate flash block, whose start address is defined in CONFIG_IXP4XX_NPE_EXT_UCODE_BASE. Using that, it is possible to build NPE-enabled u-boot without copyright problems due to the NPE firmware.
I have also removed some unused code (#if 0 currently - should we completely remove those unused parts?)
I hope the patch applies, I get whitespace-related differences in the NPE files due to trailing whitespace in the original versions.
Signed-off-by: Michael Schwingen michael@schwingen.org Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
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..c0e7349 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -134,8 +134,8 @@ 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 @@ -158,6 +158,7 @@ PRIVATE BOOL ixNpeDlImageMgrNpeFunctionIdCompare (IxNpeDlImageId *imageIdA, IxNpeDlImageId *imageIdB);
+#if 0 PRIVATE IX_STATUS ixNpeDlImageMgrImageFind_legacy (UINT32 *imageLibrary, UINT32 imageId, @@ -195,7 +196,7 @@ ixNpeDlImageMgrMicrocodeImageLibraryOverride ( status); return status; } - +#endif
/* * Function definition: ixNpeDlImageMgrImageListExtract @@ -527,6 +528,7 @@ ixNpeDlImageMgrStatsReset (void) }
+#if 0 /* * Function definition: ixNpeDlImageMgrImageFind_legacy * @@ -600,7 +602,7 @@ ixNpeDlImageMgrImageFind_legacy ( "Exiting ixNpeDlImageMgrImageFind: status = %d\n", status); return status; } - +#endif
/* * Function definition: ixNpeDlImageMgrImageFind @@ -635,6 +637,7 @@ ixNpeDlImageMgrImageFind ( #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ }
+#if 0 /* For backward's compatibility with previous image format */ if (ixNpeDlImageMgrSignatureCheck(imageLibrary)) { @@ -643,6 +646,7 @@ ixNpeDlImageMgrImageFind ( imagePtr, imageSize); } +#endif
while (*(imageLibrary+offset) == NPE_IMAGE_MARKER) {

allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index c0e7349..1c47661 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -140,6 +140,13 @@ static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCOD static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array; #endif
+static UNIT32* getIxNpeMicroCodeImageLibrary() +{ + if ((s = getenv("microcodeaddr")) != NULL) { + load_addr = simple_strtoul(s, NULL, 16); + } + else return IxNpeMicroCodeImageLibrary; +}
/* * static function prototypes. @@ -218,9 +225,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 != @@ -291,9 +298,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 != @@ -308,8 +315,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; @@ -354,9 +362,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 != @@ -633,7 +641,7 @@ ixNpeDlImageMgrImageFind ( imageLibrary = ixNpeMicrocode_binaryArray; } #else - imageLibrary = IxNpeMicroCodeImageLibrary; + imageLibrary = getIxNpeMicroCodeImageLibrary(); #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ }

On Wednesday 09 January 2008, Jean-Christophe PLAGNIOL-VILLARD wrote:
allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index c0e7349..1c47661 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -140,6 +140,13 @@ static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCOD static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array; #endif
+static UNIT32* getIxNpeMicroCodeImageLibrary() +{
- if ((s = getenv("microcodeaddr")) != NULL) {
load_addr = simple_strtoul(s, NULL, 16);
- }
- else return IxNpeMicroCodeImageLibrary;
if ((s = getenv("microcodeaddr")) != NULL) load_addr = simple_strtoul(s, NULL, 16); else return IxNpeMicroCodeImageLibrary;
please.
I'm not so sure about the naming of the env variable too. How about "npe_ucode"?
Thanks.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On 14:23 Wed 09 Jan , Stefan Roese wrote:
On Wednesday 09 January 2008, Jean-Christophe PLAGNIOL-VILLARD wrote:
allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index c0e7349..1c47661 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -140,6 +140,13 @@ static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCOD static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array; #endif
+static UNIT32* getIxNpeMicroCodeImageLibrary() +{
- if ((s = getenv("microcodeaddr")) != NULL) {
load_addr = simple_strtoul(s, NULL, 16);
- }
- else return IxNpeMicroCodeImageLibrary;
if ((s = getenv("microcodeaddr")) != NULL) load_addr = simple_strtoul(s, NULL, 16); else return IxNpeMicroCodeImageLibrary;
please.
Done.
I'm not so sure about the naming of the env variable too. How about "npe_ucode"?
Why not
Best regards, J.

allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/README b/README index 26f93c2..9a8d6d7 100644 --- a/README +++ b/README @@ -2685,6 +2685,9 @@ Some configuration options can be set using Environment Variables: are tried once without success. Useful on scripts which control the retry operation themselves. + + npe_ucode - see CONFIG_IXP4XX_NPE_EXT_UCOD + if set load address for the npe microcode
tftpsrcport - If this is set, the value is used for TFTP's UDP source port. diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index c0e7349..f7326bd 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -140,6 +140,12 @@ static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCOD static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array; #endif
+static UNIT32* getIxNpeMicroCodeImageLibrary() +{ + if ((s = getenv("npe_ucode")) != NULL) + load_addr = simple_strtoul(s, NULL, 16); + else return IxNpeMicroCodeImageLibrary; +}
/* * static function prototypes. @@ -218,9 +224,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 != @@ -291,9 +297,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 != @@ -308,8 +314,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; @@ -354,9 +361,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 != @@ -633,7 +640,7 @@ ixNpeDlImageMgrImageFind ( imageLibrary = ixNpeMicrocode_binaryArray; } #else - imageLibrary = IxNpeMicroCodeImageLibrary; + imageLibrary = getIxNpeMicroCodeImageLibrary(); #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ }

allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/README b/README index 26f93c2..9a8d6d7 100644 --- a/README +++ b/README @@ -2685,6 +2685,9 @@ Some configuration options can be set using Environment Variables: are tried once without success. Useful on scripts which control the retry operation themselves. + + npe_ucode - see CONFIG_IXP4XX_NPE_EXT_UCOD + if set load address for the npe microcode
tftpsrcport - If this is set, the value is used for TFTP's UDP source port. diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index c0e7349..b46d16d 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -140,6 +140,13 @@ static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)CONFIG_IXP4XX_NPE_EXT_UCOD static UINT32 *IxNpeMicroCodeImageLibrary = (UINT32 *)IxNpeMicrocode_array; #endif
+static UNIT32* getIxNpeMicroCodeImageLibrary() +{ + if ((s = getenv("npe_ucode")) != NULL) + load_addr = simple_strtoul(s, NULL, 16); + else + return IxNpeMicroCodeImageLibrary; +}
/* * static function prototypes. @@ -218,9 +225,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 != @@ -291,9 +298,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 != @@ -308,8 +315,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; @@ -354,9 +362,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 != @@ -633,7 +641,7 @@ ixNpeDlImageMgrImageFind ( imageLibrary = ixNpeMicrocode_binaryArray; } #else - imageLibrary = IxNpeMicroCodeImageLibrary; + imageLibrary = getIxNpeMicroCodeImageLibrary(); #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ }

On Wednesday 09 January 2008, Jean-Christophe PLAGNIOL-VILLARD wrote:
allow to load the microde from flash or ram by download it through the serial or other.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
Acked-by: Stefan Roese sr@denx.de
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Wed, Jan 09, 2008 at 01:30:11PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
From: Michael Schwingen michael@schwingen.org
Hi,
the following patch adds support to move the IXP42X NPE firmware to a separate flash block, whose start address is defined in CONFIG_IXP4XX_NPE_EXT_UCODE_BASE. Using that, it is possible to build NPE-enabled u-boot without copyright problems due to the NPE firmware.
I have also removed some unused code (#if 0 currently - should we completely remove those unused parts?)
I hope the patch applies, I get whitespace-related differences in the NPE files due to trailing whitespace in the original versions.
Signed-off-by: Michael Schwingen michael@schwingen.org Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
Thanks - I had expected some more discussion if those NPE code cleanups should be done.
Now for CONFIG_IXP4XX_NPE_EXT_UCODE_BASE to really work, one more change in the Makefile is required (which I left out when I sent the patch, but with the new Makefile structure, this is really easy to do):
Signed-off-by: Michael Schwingen michael@schwingen.org
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))
Having the NPE microcode in a seperate flash sector works well with both u-boot and with the OpenWRT patches, which expect the microcode in a separate MTD partition, so the code is in flash only once, and it should be GPL compliant.
cu Michael

On 23:05 Thu 10 Jan , Michael Schwingen wrote:
On Wed, Jan 09, 2008 at 01:30:11PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
From: Michael Schwingen michael@schwingen.org
Hi,
<snip>
- 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))
I will add this to the PATCH: load ixp42x NPE firmware from separate flash block, remove dead code too Best Regards, J.
Having the NPE microcode in a seperate flash sector works well with both u-boot and with the OpenWRT patches, which expect the microcode in a separate MTD partition, so the code is in flash only once, and it should be GPL compliant.
cu Michael
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
participants (4)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Michael Schwingen
-
Stefan Roese
-
Wolfgang Denk