Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934735AbbEOTve (ORCPT ); Fri, 15 May 2015 15:51:34 -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 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1442 Lines: 40 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); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/