From patchwork Mon Jul 6 20:26:13 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: 6727731 Return-Path: X-Original-To: patchwork-linux-arm@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 8428EC05AC for ; Mon, 6 Jul 2015 20:29:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABBB82053D for ; Mon, 6 Jul 2015 20:29:22 +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 D04D42052F for ; Mon, 6 Jul 2015 20:29:21 +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 1ZCCzM-0005yk-6X; Mon, 06 Jul 2015 20:27:40 +0000 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZCCys-0005Wm-JG for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 20:27:11 +0000 Received: by wgjx7 with SMTP id x7so150020338wgj.2 for ; Mon, 06 Jul 2015 13:26:49 -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=2pkdgOksJgtZjhhh+742qFdou6NLAVRHgzwX6RH5aTE=; b=Z20PlypCxSVdrciquw7Svbh2Oks8S0ys2CYcmUSB1PCKyqB6j7GH1MBmNCWatIdij3 khb7AuDV34V0ZLqDruN2WbvQZN8K6fq3dgDygNZ9IbNf1YwKLAQGCULRDC5rlgejzI/o TD9mQb3ZvDYZ2Pjz/7z1Hor3k9JbsvK07iG35Yx7RxyJ5CI4/3cAZWnM7InqFwqyN2kV tR/+jV8K4hcjWVzDgAZCQsB3Hf+7m7yEePbLIJ1hJbL0QpIx430UBwi6kEXmVSwrcEDh n1RnSUUBJuxBekjfk6H+lmllpdY29lU4GJgMpx5a0J5rS/a1iXr47/uaC3cYn8y0hqXW QMAw== X-Received: by 10.194.120.230 with SMTP id lf6mr1356340wjb.41.1436214409001; Mon, 06 Jul 2015 13:26:49 -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 ck18sm29869344wjb.47.2015.07.06.13.26.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 13:26:48 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Russell King , Laura Abbott , Grant Likely , Rob Herring , Will Deacon , Ivaylo Dimitrov , Sebastian Reichel , Pavel Machek , Tony Lindgren , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 5/5] arm: boot: store ATAGs structure into DT "/chosen/linux, atags" entry Date: Mon, 6 Jul 2015 22:26:13 +0200 Message-Id: <1436214373-12969-6-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436214373-12969-1-git-send-email-pali.rohar@gmail.com> References: <1436214373-12969-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-20150706_132710_779924_4F1E8EC3 X-CRM114-Status: GOOD ( 13.43 ) X-Spam-Score: -2.7 (--) 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: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= 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.8 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 Legacy bootloaders can pass additional information for kernel or legacy userspace applications. When booting DT kernel then ATAGs structure is not more visible after running kernel uncompress code. This patch stores full ATAGs structure into DT "/chosen/linux,atags" entry, so kernel can later reuse it and export via /proc/atags to userspace. 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 e7e1cc9..ae93973 100644 --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c @@ -112,7 +112,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) @@ -189,5 +189,9 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) 4 * memcount * memsize); } + /* include the terminating ATAG_NONE */ + atag_size = (char *)atag - (char *)atag_list + sizeof(struct tag_header); + setprop(fdt, "/chosen", "linux,atags", atag_list, atag_size); + return fdt_pack(fdt); }