Re: [U-Boot] [PATCH 2/2] powerpc/bootcount: Fix endianness problem
Dear Detlev Zundel, In message 1274364575-9764-2-git-send-email-...@denx.de you wrote: From: Michael Weiss michael.we...@ifm.com For CONFIG_SYS_BOOTCOUNT_SINGLEWORD the code had an endianness problem. Signed-off-by: Michael Weiss michael.we...@ifm.com Signed-off-by: Detlev Zundel d...@denx.de --- arch/powerpc/lib/bootcount.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Applied, thanks. [Patch 1/2 is not a fix but new code, it is on hold for the next branch.] Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It is necessary to have purpose. -- Alice #1, I, Mudd, stardate 4513.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] powerpc/bootcount: Fix endianness problem
From: Michael Weiss michael.we...@ifm.com For CONFIG_SYS_BOOTCOUNT_SINGLEWORD the code had an endianness problem. Signed-off-by: Michael Weiss michael.we...@ifm.com Signed-off-by: Detlev Zundel d...@denx.de --- arch/powerpc/lib/bootcount.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/lib/bootcount.c b/arch/powerpc/lib/bootcount.c index 0373a20..07ef28d 100644 --- a/arch/powerpc/lib/bootcount.c +++ b/arch/powerpc/lib/bootcount.c @@ -82,10 +82,12 @@ ulong bootcount_load(void) void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR; #if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) - if (in_be16(reg + 2) != (BOOTCOUNT_MAGIC 0x)) + u32 tmp = in_be32(reg); + + if ((tmp 0x) != (BOOTCOUNT_MAGIC 0x)) return 0; else - return in_be16(reg); + return (tmp 0x); #else if (in_be32(reg + 4) != BOOTCOUNT_MAGIC) return 0; -- 1.6.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot