From patchwork Fri Feb 12 14:57:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61864 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp873006lbl; Fri, 12 Feb 2016 06:59:13 -0800 (PST) X-Received: by 10.66.234.104 with SMTP id ud8mr2638834pac.143.1455289153577; Fri, 12 Feb 2016 06:59:13 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i89si20463163pfj.228.2016.02.12.06.59.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 06:59:13 -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 1aUFAj-00030w-0r; Fri, 12 Feb 2016 14:58:13 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUFAU-0002rP-Sl for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2016 14:58:00 +0000 Received: by mail-wm0-x234.google.com with SMTP id p63so24307855wmp.1 for ; Fri, 12 Feb 2016 06:57:38 -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=5xVCW7OJswHwpnjcUvUUEPRWsB1AF1kgCiPGiOkBqWo=; b=GBKoqmuFBc4ueXi7RL8y5PsIYAog+pUrbTs1qNtWcMDfyK7MtGCdnyUrIrPGDUTDNn yUEGm1/uy4dIqZ4U2CV9bkKYEowq0iC6BRBNY5tyiVyptrmAxLg7FKGBSdwO7khjnYvc 8+dOI20pckd5saNCSOoczGaCxWBvnecFR0xE4= 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=5xVCW7OJswHwpnjcUvUUEPRWsB1AF1kgCiPGiOkBqWo=; b=YLZzS9XI/HP49EtOLgjV1Kz1vI+zT9OvTx5yvvc8YSQMV10Ohz6QPx/tJXBw7IkbNk hCgcAIRJZFCBBpGB7KxqYzvPaHqR/yzocP0oJ7cdPJpgTAzUFMyPAhfqPoSe3vg9mKC1 CgCVUdDTwYWvYRNM+59229Wo9d4zYSMFTHWiAGh2chfHfBWX+44rpSbyRO6wxMfx0gFU HVPrm3u7YTR93iUoD9qOQAAVls2xjfySpe26JLv5zzZ1LxjmzYZIkENgYeo8FlnvSsk2 2WWGqfStwv3vryQMCeZ5uXG+DZjVhdVLo1tdNa64suRPjy0coKGe45iXvdHN4Bo4KdnK /arw== X-Gm-Message-State: AG10YOS5i7JxSIPpjTT9T/ZjBmIoBnXpjO43MlzYdTe4BXB34/yzsq3f3bSM6bpWwVIW86s2 X-Received: by 10.28.127.5 with SMTP id a5mr5142625wmd.32.1455289057156; Fri, 12 Feb 2016 06:57:37 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id e9sm12412008wja.25.2016.02.12.06.57.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 06:57:36 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, arnd@arndb.de Subject: [PATCH v3 1/4] of/fdt: factor out assignment of initrd_start/initrd_end Date: Fri, 12 Feb 2016 15:57:23 +0100 Message-Id: <1455289046-21321-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455289046-21321-1-git-send-email-ard.biesheuvel@linaro.org> References: <1455289046-21321-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160212_065759_169832_FA39B2B6 X-CRM114-Status: GOOD ( 11.20 ) 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:234 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: dave.martin@arm.com, Ard Biesheuvel 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. Cc: Rob Herring 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 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);