From: Ivaylo Dimitrov Date: Wed, 10 Feb 2016 18:23:02 +0000 (+0200) Subject: ARM: OMAP2+: Set system_rev from ATAGS for n900 X-Git-Tag: v4.14-rc1~3760^2~2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f35dc47c1744110d4119c4aa2a00872e8a1217b;p=platform%2Fkernel%2Flinux-rpi.git ARM: OMAP2+: Set system_rev from ATAGS for n900 This fixed a regression with DT boot compared to legacy boot. Reviewed-by: Pali Rohár Tested-by: Pali Rohár Signed-off-by: Ivaylo Dimitrov [tony@atomide.com: edited patch subject to follow standard] Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 8098272..bab814d 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -18,6 +18,7 @@ #include #include +#include #include "common.h" @@ -77,12 +78,31 @@ static const char *const n900_boards_compat[] __initconst = { NULL, }; +/* Set system_rev from atags */ +static void __init rx51_set_system_rev(const struct tag *tags) +{ + const struct tag *tag; + + if (tags->hdr.tag != ATAG_CORE) + return; + + for_each_tag(tag, tags) { + if (tag->hdr.tag == ATAG_REVISION) { + system_rev = tag->u.revision.rev; + break; + } + } +} + /* Legacy userspace on Nokia N900 needs ATAGS exported in /proc/atags, * save them while the data is still not overwritten */ static void __init rx51_reserve(void) { - save_atags((const struct tag *)(PAGE_OFFSET + 0x100)); + const struct tag *tags = (const struct tag *)(PAGE_OFFSET + 0x100); + + save_atags(tags); + rx51_set_system_rev(tags); omap_reserve(); }