Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327982

[PATCH] ARM: RX51: Set system_rev from ATAGS

From Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] ARM: RX51: Set system_rev from ATAGS
Date 2016-02-05 19:20 +0100
Message-ID <qYT99-3Jt-29@gated-at.bofh.it> (permalink)
References <qNyhH-1x1-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 arch/arm/mach-omap2/board-generic.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 8098272..b91fabe 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -18,6 +18,7 @@
 
 #include <asm/setup.h>
 #include <asm/mach/arch.h>
+#include <asm/system_info.h>
 
 #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_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_system_rev(tags);
 	omap_reserve();
 }
 
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] ARM: RX51: Set system_rev from ATAGS Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-02-05 19:20 +0100
  Re: [PATCH] ARM: RX51: Set system_rev from ATAGS Tony Lindgren <tony@atomide.com> - 2016-02-08 21:50 +0100
  Re: [PATCH] ARM: RX51: Set system_rev from ATAGS Pali Rohár <pali.rohar@gmail.com> - 2016-02-08 22:20 +0100

csiph-web