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: 8237991 Return-Path: X-Original-To: patchwork-linux-arm@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 8B3709F6DA for ; Fri, 5 Feb 2016 18:17:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93D9420266 for ; Fri, 5 Feb 2016 18:17:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8DFE20265 for ; Fri, 5 Feb 2016 18:17:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRkvm-0006Ev-Kg; Fri, 05 Feb 2016 18:16:30 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRkvk-00068s-1V for linux-arm-kernel@lists.infradead.org; Fri, 05 Feb 2016 18:16:28 +0000 Received: by mail-wm0-x244.google.com with SMTP id p63so4115730wmp.1 for ; Fri, 05 Feb 2016 10:16:07 -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=Y6Z+o5BxxhInWlXmMt6BDJQnHzslpTkgQlGRLoIwAai+CKaC8pHwCo8IdS78z+cjbu 9s5KGQzrSaJdBwWMcpQqXcqV3n95SlRBXQCdALkF8iXAkAIn33hvv7wURCaEHDPhrtiI K4ahDKkkUk0aAWD1NJHMVkmS6wQL5RlzozA7sPJM6BglqhFUQr7BlUHWEV0iJLelaNFb 7I+JvCdycvqstRvSB3wGlNPVHV4FwZlFqi7luMHXnG4e3SNHdetbFDSYXQbc3Oef3Ekx 4bfzBRiWE8vg351IaIQTv9SToIBhuo6ixCr3TSP2bgAAKk2e2+Bpm4sV+BbS0MK0V450 DdSQ== X-Gm-Message-State: AG10YOT/qnusIhKNwNN0pw7DiwIPIQpXbfp1GtVkwcgznb1EmJmqZQvusJnQla2rQQb74Q== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160205_101628_275387_F4A371CD X-CRM114-Status: GOOD ( 13.20 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ivaylo Dimitrov , arnd@arndb.de, linux-kernel@vger.kernel.org, pali.rohar@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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(); }