diff options
author | Wolfgang Denk <wd@denx.de> | 2009-02-01 21:24:38 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-02-01 21:24:38 +0100 |
commit | f4b6f45dcba989f5a900edc07ececae80c79abdf (patch) | |
tree | 85e623dc76eba877275c5978a6527f368975abb2 /cpu/ixp/npe/IxNpeDlImageMgr.c | |
parent | a87fb1b308a2a375cb9ca74ca0dd3e2c5793d3bf (diff) | |
parent | 930590f3e49c8f32256edf2e5861e1535a329c6c (diff) | |
download | u-boot-imx-f4b6f45dcba989f5a900edc07ececae80c79abdf.zip u-boot-imx-f4b6f45dcba989f5a900edc07ececae80c79abdf.tar.gz u-boot-imx-f4b6f45dcba989f5a900edc07ececae80c79abdf.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-ixp
Diffstat (limited to 'cpu/ixp/npe/IxNpeDlImageMgr.c')
-rw-r--r-- | cpu/ixp/npe/IxNpeDlImageMgr.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/cpu/ixp/npe/IxNpeDlImageMgr.c b/cpu/ixp/npe/IxNpeDlImageMgr.c index ccc0da7..9bcdc9c 100644 --- a/cpu/ixp/npe/IxNpeDlImageMgr.c +++ b/cpu/ixp/npe/IxNpeDlImageMgr.c @@ -133,20 +133,14 @@ typedef struct */ static IxNpeDlImageMgrStats ixNpeDlImageMgrStats; -/* default image */ -#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; + return NULL; } /* @@ -422,7 +416,7 @@ ixNpeDlImageMgrSignatureCheck (UINT32 *microCodeImageLibrary) (IxNpeDlImageMgrImageLibraryHeader *) microCodeImageLibrary; BOOL result = TRUE; - if (header->signature != IX_NPEDL_IMAGEMGR_SIGNATURE) + if (!header || header->signature != IX_NPEDL_IMAGEMGR_SIGNATURE) { result = FALSE; ixNpeDlImageMgrStats.invalidSignature++; @@ -643,6 +637,11 @@ ixNpeDlImageMgrImageFind ( } #else imageLibrary = getIxNpeMicroCodeImageLibrary(); + if (imageLibrary == NULL) + { + printf ("npe: ERROR, no Microcode found in memory\n"); + return IX_FAIL; + } #endif /* IX_NPEDL_READ_MICROCODE_FROM_FILE */ } |