From patchwork Tue Feb 16 12:52:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62012 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1645400lbl; Tue, 16 Feb 2016 04:55:02 -0800 (PST) X-Received: by 10.98.73.6 with SMTP id w6mr31108237pfa.82.1455627299417; Tue, 16 Feb 2016 04:54:59 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ff7si51136979pab.184.2016.02.16.04.54.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 04:54:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org 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 1aVf8Z-0008DU-Ug; Tue, 16 Feb 2016 12:53:51 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVf89-00082T-Ae for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 12:53:26 +0000 Received: by mail-wm0-x232.google.com with SMTP id g62so105573440wme.1 for ; Tue, 16 Feb 2016 04:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lz0QSecDpDwQzzZdGOnqiVVrB3a3QuUSuGA/WuQe94Y=; b=HuDiuwlxbQjjedcEPnEgPJ183GXUHau9rzF907iMx5/deVWIHzBZrp46b/5V8qo8mW b/LgwVJRHubM2Iaecm0dxCzmSodWdgR9KGAiaSq7JfIcDDn3kN3jobS0cMHfMvJtnu19 V8pp3wHYhKF2AA7B+qOiFr72Jwe5V7oqgHgU0= 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=lz0QSecDpDwQzzZdGOnqiVVrB3a3QuUSuGA/WuQe94Y=; b=K7302YZQEQ98WuIZvtlh2dtNMWcradAb1Sd0+wJbHt9kB3PAV4/YxaeI39hl+PnDSp l2k+4cTYg/eybCYb0+ccVYvO/atm/5hw7xAh2qwh1T0bnW1DJCTNdGR+X+UlstfPO5po p4i2nh/ArQ79/zlipp4TFehMqRILL8GdJz6f/LfjAlwM7FjUNfGELkfLNnBq3sp1aAFL 8KyRz2VAWB671nuLmMkq4N7Kx2l+QG3VCLmutSc884+UXevdlwLetol4bNWJLvaJIcbu c+LiQDAqOxZJRrELY3S6xSZnsgR7DzpBdsHw5iVy8pAkCIR0L5O1DSjzGO3hkX4cqq2j z9Ag== X-Gm-Message-State: AG10YOQdgumUFAhv3KzM7HlwJKQxbZP0X2XmGqOn4MPSMCL7fyikLTXNOjrtat3R+EDAvfvS X-Received: by 10.28.0.86 with SMTP id 83mr20007532wma.63.1455627183768; Tue, 16 Feb 2016 04:53:03 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id x66sm20454816wmb.20.2016.02.16.04.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Feb 2016 04:53:03 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, keescook@chromium.org Subject: [PATCH v6sub1 02/11] of/fdt: factor out assignment of initrd_start/initrd_end Date: Tue, 16 Feb 2016 13:52:33 +0100 Message-Id: <1455627162-31600-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455627162-31600-1-git-send-email-ard.biesheuvel@linaro.org> References: <1455627162-31600-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160216_045325_633700_E470FB0E X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: marc.zyngier@arm.com, Ard Biesheuvel , james.morse@arm.com, laurentiu.tudor@nxp.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Since architectures may not yet have their linear mapping up and running when the initrd address is discovered from the DT, factor out the assignment of initrd_start and initrd_end, so that an architecture can override it and use the translation it needs. Signed-off-by: Ard Biesheuvel --- drivers/of/fdt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel Acked-by: Rob Herring diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 1f98156f8996..3e90bce70545 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -760,6 +760,16 @@ const void * __init of_flat_dt_match_machine(const void *default_match, } #ifdef CONFIG_BLK_DEV_INITRD +#ifndef __early_init_dt_declare_initrd +static void __early_init_dt_declare_initrd(unsigned long start, + unsigned long end) +{ + initrd_start = (unsigned long)__va(start); + initrd_end = (unsigned long)__va(end); + initrd_below_start_ok = 1; +} +#endif + /** * early_init_dt_check_for_initrd - Decode initrd location from flat tree * @node: reference to node containing initrd location ('chosen') @@ -782,9 +792,7 @@ static void __init early_init_dt_check_for_initrd(unsigned long node) return; end = of_read_number(prop, len/4); - initrd_start = (unsigned long)__va(start); - initrd_end = (unsigned long)__va(end); - initrd_below_start_ok = 1; + __early_init_dt_declare_initrd(start, end); pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", (unsigned long long)start, (unsigned long long)end);