[U-Boot] [PATCH] image: fix IH_ARCH_... values for uImage compatibility

Commit 555f45d8f916 ("image: Convert the IH_... values to enums") accidentally changed some IH_ARCH_... values.
Originally, there existed a gap between IH_ARCH_M68K and IH_ARCH_MICROBLAZE, like follows.
#define IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ #define IH_ARCH_M68K 12 /* M68K */ #define IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ #define IH_ARCH_NIOS2 15 /* Nios-II */
The enum conversion broke the compatibility with existing uImage files. Reverting 555f45d8f916 will cause build error unfortunately, so here is another way to fix it more easily.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com ---
include/image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/image.h b/include/image.h index 2a5b560..b43b179 100644 --- a/include/image.h +++ b/include/image.h @@ -182,7 +182,7 @@ enum { IH_ARCH_SPARC, /* Sparc */ IH_ARCH_SPARC64, /* Sparc 64 Bit */ IH_ARCH_M68K, /* M68K */ - IH_ARCH_MICROBLAZE, /* MicroBlaze */ + IH_ARCH_MICROBLAZE = 14, /* MicroBlaze */ IH_ARCH_NIOS2, /* Nios-II */ IH_ARCH_BLACKFIN, /* Blackfin */ IH_ARCH_AVR32, /* AVR32 */

Hi Masahiro,
On 20 July 2016 at 07:09, Masahiro Yamada yamada.masahiro@socionext.com wrote:
Commit 555f45d8f916 ("image: Convert the IH_... values to enums") accidentally changed some IH_ARCH_... values.
Originally, there existed a gap between IH_ARCH_M68K and IH_ARCH_MICROBLAZE, like follows.
#define IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ #define IH_ARCH_M68K 12 /* M68K */ #define IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ #define IH_ARCH_NIOS2 15 /* Nios-II */
The enum conversion broke the compatibility with existing uImage files. Reverting 555f45d8f916 will cause build error unfortunately, so here is another way to fix it more easily.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com
include/image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
I had forgotten that and did not notice the discontinuous numbers. Perhaps the next one we allocate should go in the gap? Also I suggest a comment before each enum to explain this.
diff --git a/include/image.h b/include/image.h index 2a5b560..b43b179 100644 --- a/include/image.h +++ b/include/image.h @@ -182,7 +182,7 @@ enum { IH_ARCH_SPARC, /* Sparc */ IH_ARCH_SPARC64, /* Sparc 64 Bit */ IH_ARCH_M68K, /* M68K */
IH_ARCH_MICROBLAZE, /* MicroBlaze */
IH_ARCH_MICROBLAZE = 14, /* MicroBlaze */ IH_ARCH_NIOS2, /* Nios-II */ IH_ARCH_BLACKFIN, /* Blackfin */ IH_ARCH_AVR32, /* AVR32 */
-- 1.9.1
participants (2)
-
Masahiro Yamada
-
Simon Glass