From patchwork Fri Feb 5 18:15:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8237981 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 24B6E9F6DA for ; Fri, 5 Feb 2016 18:16:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4459920397 for ; Fri, 5 Feb 2016 18:16:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6035620265 for ; Fri, 5 Feb 2016 18:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756379AbcBESQJ (ORCPT ); Fri, 5 Feb 2016 13:16:09 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35181 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756372AbcBESQI (ORCPT ); Fri, 5 Feb 2016 13:16:08 -0500 Received: by mail-wm0-f68.google.com with SMTP id g62so4113353wme.2; Fri, 05 Feb 2016 10:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vPts255j6AgOP7csiBXjpXfJ4U4M1sQ2HUfbfoPEKmw=; b=VJg89F5El8yKONMzzP0K5g8XXVrLjU/VfcUeG6DhB44HWsqm+7AOd8J4vjAY7JN63t +b5/7YxlrQEX0bTbm+vRwMOBX1PdWCQWfzYDjQBvDcXSgumpPa+P7mLuerXMl0xfIFl3 gq3F89ZbWHts36a3WCt13DDVU3r7+/JtNwKgqRe0L1rRKIOIh5OTb/c8fIQ1jy0CYqj4 AUJFUyj1cYXiOXeMneg1UuWg+KPnrBD5N0FtlEKBO77yZGYr0cpOWdvZZzZIRS28Mws4 T8uxh+KFy1a8pGDF0hU4rC0gzw88rgs75eUq/DZzosGFTNF3tq+WyuJ9BDp/HTGgAWvL +5aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vPts255j6AgOP7csiBXjpXfJ4U4M1sQ2HUfbfoPEKmw=; b=LZVGWZAEi5/Mn7Rsx877pObhmazkPcN/QLrXvNz0cRcZms0xsXkQvdhVoqX4x+755v tkYtF9p+FxxH2crKeNBHquI36fgtfVW99mmFAiR/lJQXU1UpYKqJfW9IuwVUBhNd6Tir y+vcECo5atzMkF65XwPT4kxoieik+aVT5HNcPKVw/wWv1EOxgO3BExxcDvV15xBsPLAd g2Rf9snYo/p5GJUGCWP1qjQyAzAFunFsTY45VTMDdqqaZAGt0tW69YGXCZBtqaeaHb2Y RIYBLgBNUW8+trvVc+CBj8C2jyydZe/ivBjsv5bH56vuMWSZF8fTkmXXBLhVh1C9tNFE HAHQ== X-Gm-Message-State: AG10YORv+89Pd/5/OwI+pA0b53RHUAJ8xPOpVJ+FPiXlQxQ/Fbs+gRzE2WIj1Cf+WKn84g== X-Received: by 10.194.7.67 with SMTP id h3mr15095361wja.44.1454696166167; Fri, 05 Feb 2016 10:16:06 -0800 (PST) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id m63sm3475966wmc.3.2016.02.05.10.16.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 10:16:05 -0800 (PST) From: Ivaylo Dimitrov To: tony@atomide.com, linux@arm.linux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, pali.rohar@gmail.com, arnd@arndb.de, Ivaylo Dimitrov Subject: [PATCH] ARM: RX51: Set system_rev from ATAGS Date: Fri, 5 Feb 2016 20:15:02 +0200 Message-Id: <1454696102-2214-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <3663322.UyrB2OmX6o@wuerfel> References: <3663322.UyrB2OmX6o@wuerfel> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ivaylo Dimitrov Reviewed-by: Pali Rohár Tested-by: Pali Rohár --- 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 #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_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(); }