From patchwork Fri May 15 19:50:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 6416211 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 1BE37C0432 for ; Fri, 15 May 2015 19:51:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 437872051A for ; Fri, 15 May 2015 19:51:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F5A82055D for ; Fri, 15 May 2015 19:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934691AbbEOTvd (ORCPT ); Fri, 15 May 2015 15:51:33 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:34162 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934539AbbEOTv2 (ORCPT ); Fri, 15 May 2015 15:51:28 -0400 Received: by wguv19 with SMTP id v19so63296915wgu.1; Fri, 15 May 2015 12:51:27 -0700 (PDT) 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 :mime-version:content-type:content-transfer-encoding; bh=JMZEaRuEn/8YM57Y3GcJFlUD9ndQRfSvqJK/skKbuoc=; b=Jo2tBiTqRj7OkYlE7sKdwb5bFwzBZQziei62k7bQzvAU+Z6wnNrx3OAq2tACelTX0J U8BaThQZ4tdNylZmT+K3cqYkLFvr9t+InQ/Eqea3b+nEI8Dph3+1dVRoM8H9cPMmx3dx XgzdcbufgDNSjt8TxWt8oDqDW6M8Kf/ciRQ68dYsGXP+r4ZX/M7hvI/Zgo1GfD9PbdMh wb2dyjhiqu1ElwKI39hB3GBlYsLlYlucuvRCqkSgDNDsJ6/CCJoDM75YIjytWAVi0WxD M7HvSGFpC/zg/czfJ4c3Fpd1ptGvbROzjSrqeJbYFwwahSqe4U4I6b2Lst8Rr2zugVCG 3LYg== X-Received: by 10.194.71.51 with SMTP id r19mr8724086wju.74.1431719487410; Fri, 15 May 2015 12:51:27 -0700 (PDT) Received: from Pali-Latitude.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id nb9sm4415341wic.10.2015.05.15.12.51.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 12:51:26 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Rob Herring , Russell King , Will Deacon , Ivaylo Dimitrov , Sebastian Reichel , Pavel Machek , Tony Lindgren , =?UTF-8?q?Andreas=20F=C3=A4rber?= Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 2/2] arm: boot: store ATAG structure into DT atags field Date: Fri, 15 May 2015 21:50:07 +0200 Message-Id: <1431719407-18230-3-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1431719407-18230-1-git-send-email-pali.rohar@gmail.com> References: <1430902142-17035-1-git-send-email-pali.rohar@gmail.com> <1431719407-18230-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 This patch stores existing ATAG structure into DT /atags field and so previous patch exports it for userspace via /proc/atags. Signed-off-by: Pali Rohár --- arch/arm/boot/compressed/atags_to_fdt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c index b23748e..4a4a70c 100644 --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c @@ -145,7 +145,7 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) * address and size for each bank */ uint32_t mem_reg_property[2 * 2 * NR_BANKS]; int memcount = 0; - int ret, memsize; + int ret, memsize, atag_size; /* make sure we've got an aligned pointer */ if ((u32)atag_list & 0x3) @@ -219,6 +219,10 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) } } + /* include the terminating ATAG_NONE */ + atag_size = (char *)atag - (char *)atag_list + sizeof(struct tag_header); + setprop(fdt, "/", "atags", atag_list, atag_size); + if (memcount) { setprop(fdt, "/memory", "reg", mem_reg_property, 4 * memcount * memsize);