From patchwork Wed Feb 10 18:23:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8273861 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76052BEEE5 for ; Wed, 10 Feb 2016 18:24:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D91982039E for ; Wed, 10 Feb 2016 18:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CEDE2038F for ; Wed, 10 Feb 2016 18:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752603AbcBJSXc (ORCPT ); Wed, 10 Feb 2016 13:23:32 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33096 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbcBJSXb (ORCPT ); Wed, 10 Feb 2016 13:23:31 -0500 Received: by mail-wm0-f66.google.com with SMTP id c200so5917737wme.0; Wed, 10 Feb 2016 10:23:30 -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=1ci+dnwdIPu0/XpwmXpgUSHxjgeu8XOw6OWAItuktJk=; b=E3NQH4auus+sMzdLuXi4/Fzyf3O8lnem1yr8bR1G0wuqyKqAL4MmKPkK3z9x1e4skB eIZcqoyVNe6hGuBr+Cc/cGzTWmoHqpJYGg3Z7nbvpQ9kt/NtrLVnTWXrFUfdsKa7EbfU 3yVlJARpSXBsJ2WUf0AIG+xrsJ1DTU717Dahsj7GhVBUvw+dijmbx4+iWQVC0UinZH/O IVK8sHw1dXOvSmaLB0NwgngUvbl/+boCO3KKB6q75Ih+PI+ckGEsf3TqoF0mtCGpCInj Z7V2ojr0chO/HGoSP0pSTnPmtnttQrrrqtC47zELUX3PmHXHpsEIvjVRWrPV7SpWZZHq J33A== 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=1ci+dnwdIPu0/XpwmXpgUSHxjgeu8XOw6OWAItuktJk=; b=ievv4Yk6Av+dwQAaYzUFMNrxEa/v0oM/P7+bhCtMwQAZF93CVrrIbI8U3avYuDxjsA wzjnw74QVVCoPrRw6r2sYe33d6uaX3VUw0FgAugESCdzLHdRAn1LPrhodxfVHZ3HxEuI ORbBWxIiZtU5R/We6Tsom2O30wUyF+0jyjQihvDJ/W5mEnwrM/xPzEupouuGoOethjno rWiKQmcdLhxgVWnMASOLtNqhzr6ip9pMiR+fexvT60uPoy9Vd2HCB1iHF4JeUkuAT4dd x0/qjHwVGUfz37XT0cb5EKQvo/Vvjs70VB/xaL8H6xmt5bfLqSMZ4F+29P5UEa72yhTZ dogQ== X-Gm-Message-State: AG10YOQu9GoN6CML5xneiKytZg8dhQkfBPihw/pFTJGN2IO8rYc6WjK4uT9B/NP30rYrQA== X-Received: by 10.194.104.198 with SMTP id gg6mr38906297wjb.84.1455128609730; Wed, 10 Feb 2016 10:23:29 -0800 (PST) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id u9sm10004085wmd.4.2016.02.10.10.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 10:23:28 -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 v1] ARM: RX51: Set system_rev from ATAGS Date: Wed, 10 Feb 2016 20:23:02 +0200 Message-Id: <1455128582-25669-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20160209161659.GJ19432@atomide.com> References: <20160209161659.GJ19432@atomide.com> 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.0 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=unavailable 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 This fixed a regression with DT boot compared to legacy boot. Signed-off-by: Ivaylo Dimitrov --- 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..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(); }