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: 6416241 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 1E6479F444 for ; Fri, 15 May 2015 19:54:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EDF520544 for ; Fri, 15 May 2015 19:54:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E87720558 for ; Fri, 15 May 2015 19:54:28 +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 1YtLeY-0002QK-4F; Fri, 15 May 2015 19:52:14 +0000 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtLe9-0002Ie-Cj for linux-arm-kernel@lists.infradead.org; Fri, 15 May 2015 19:51:50 +0000 Received: by wgbhc8 with SMTP id hc8so91687006wgb.3 for ; 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?= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150515_125149_609140_6247BE52 X-CRM114-Status: GOOD ( 11.21 ) X-Spam-Score: -0.8 (/) Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 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);