* [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility
@ 2016-07-21 6:16 Masahiro Yamada
2016-07-21 9:07 ` Michal Simek
2016-07-21 14:47 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2016-07-21 6:16 UTC (permalink / raw)
To: u-boot
Commit 555f45d8f916 ("image: Convert the IH_... values to enums")
accidentally changed some IH_ARCH_... values.
Prior to that commit, 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 a more easy fix.
I dug the git history and figured out the gap was introduced by
commit 1117cbf2adac ("nios: remove nios-32 arch"). So, I revived
IH_ARCH_NIOS just for filling the gap.
I added comments to each enum block. Once we assign a value to
IH_... it is not allowed to change it.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Different way to fix the issue
- Add more comments
include/image.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/image.h b/include/image.h
index 2a5b560..734def3 100644
--- a/include/image.h
+++ b/include/image.h
@@ -134,6 +134,9 @@ enum ih_category {
/*
* Operating System Codes
+ *
+ * The following are exposed to uImage header.
+ * Do not change values for backward compatibility.
*/
enum {
IH_OS_INVALID = 0, /* Invalid OS */
@@ -167,6 +170,9 @@ enum {
/*
* CPU Architecture Codes (supported by Linux)
+ *
+ * The following are exposed to uImage header.
+ * Do not change values for backward compatibility.
*/
enum {
IH_ARCH_INVALID = 0, /* Invalid CPU */
@@ -182,6 +188,7 @@ enum {
IH_ARCH_SPARC, /* Sparc */
IH_ARCH_SPARC64, /* Sparc 64 Bit */
IH_ARCH_M68K, /* M68K */
+ IH_ARCH_NIOS, /* Nios-32 */
IH_ARCH_MICROBLAZE, /* MicroBlaze */
IH_ARCH_NIOS2, /* Nios-II */
IH_ARCH_BLACKFIN, /* Blackfin */
@@ -234,6 +241,9 @@ enum {
* U-Boot's command interpreter; this feature is especially
* useful when you configure U-Boot to use a real shell (hush)
* as command interpreter (=> Shell Scripts).
+ *
+ * The following are exposed to uImage header.
+ * Do not change values for backward compatibility.
*/
enum {
@@ -273,6 +283,9 @@ enum {
/*
* Compression Types
+ *
+ * The following are exposed to uImage header.
+ * Do not change values for backward compatibility.
*/
enum {
IH_COMP_NONE = 0, /* No Compression Used */
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility
2016-07-21 6:16 [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility Masahiro Yamada
@ 2016-07-21 9:07 ` Michal Simek
2016-07-21 14:47 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2016-07-21 9:07 UTC (permalink / raw)
To: u-boot
On 21.7.2016 08:16, Masahiro Yamada wrote:
> Commit 555f45d8f916 ("image: Convert the IH_... values to enums")
> accidentally changed some IH_ARCH_... values.
>
> Prior to that commit, 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 a more easy fix.
>
> I dug the git history and figured out the gap was introduced by
> commit 1117cbf2adac ("nios: remove nios-32 arch"). So, I revived
> IH_ARCH_NIOS just for filling the gap.
>
> I added comments to each enum block. Once we assign a value to
> IH_... it is not allowed to change it.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Different way to fix the issue
> - Add more comments
>
> include/image.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/image.h b/include/image.h
> index 2a5b560..734def3 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -134,6 +134,9 @@ enum ih_category {
>
> /*
> * Operating System Codes
> + *
> + * The following are exposed to uImage header.
> + * Do not change values for backward compatibility.
> */
> enum {
> IH_OS_INVALID = 0, /* Invalid OS */
> @@ -167,6 +170,9 @@ enum {
>
> /*
> * CPU Architecture Codes (supported by Linux)
> + *
> + * The following are exposed to uImage header.
> + * Do not change values for backward compatibility.
> */
> enum {
> IH_ARCH_INVALID = 0, /* Invalid CPU */
> @@ -182,6 +188,7 @@ enum {
> IH_ARCH_SPARC, /* Sparc */
> IH_ARCH_SPARC64, /* Sparc 64 Bit */
> IH_ARCH_M68K, /* M68K */
> + IH_ARCH_NIOS, /* Nios-32 */
> IH_ARCH_MICROBLAZE, /* MicroBlaze */
> IH_ARCH_NIOS2, /* Nios-II */
> IH_ARCH_BLACKFIN, /* Blackfin */
> @@ -234,6 +241,9 @@ enum {
> * U-Boot's command interpreter; this feature is especially
> * useful when you configure U-Boot to use a real shell (hush)
> * as command interpreter (=> Shell Scripts).
> + *
> + * The following are exposed to uImage header.
> + * Do not change values for backward compatibility.
> */
>
> enum {
> @@ -273,6 +283,9 @@ enum {
>
> /*
> * Compression Types
> + *
> + * The following are exposed to uImage header.
> + * Do not change values for backward compatibility.
> */
> enum {
> IH_COMP_NONE = 0, /* No Compression Used */
>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility
2016-07-21 6:16 [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility Masahiro Yamada
2016-07-21 9:07 ` Michal Simek
@ 2016-07-21 14:47 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-07-21 14:47 UTC (permalink / raw)
To: u-boot
On Thu, Jul 21, 2016 at 03:16:00PM +0900, Masahiro Yamada wrote:
> Commit 555f45d8f916 ("image: Convert the IH_... values to enums")
> accidentally changed some IH_ARCH_... values.
>
> Prior to that commit, 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 a more easy fix.
>
> I dug the git history and figured out the gap was introduced by
> commit 1117cbf2adac ("nios: remove nios-32 arch"). So, I revived
> IH_ARCH_NIOS just for filling the gap.
>
> I added comments to each enum block. Once we assign a value to
> IH_... it is not allowed to change it.
>
> Acked-by: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160721/4bd94016/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-21 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 6:16 [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility Masahiro Yamada
2016-07-21 9:07 ` Michal Simek
2016-07-21 14:47 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox