From patchwork Thu Feb 11 16:48:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61789 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp316078lbl; Thu, 11 Feb 2016 08:49:51 -0800 (PST) X-Received: by 10.98.14.146 with SMTP id 18mr50596977pfo.35.1455209390465; Thu, 11 Feb 2016 08:49:50 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q10si13595505pfq.39.2016.02.11.08.49.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 08:49:50 -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 1aTuQC-0001qw-Ck; Thu, 11 Feb 2016 16:48:48 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTuPw-0001F7-3z for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2016 16:48:33 +0000 Received: by mail-wm0-x22e.google.com with SMTP id 128so29282583wmz.1 for ; Thu, 11 Feb 2016 08:48:11 -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=ISauC6bYaygEYzgQSfhd4oQxPoMw3Jqoh2mI+fApQWg=; b=LJ0G/YhQJfMXX3CuQQ6HQpvPw9REIFw3rdhmZsh2n8GHZTJ9r8i5EU+tK6v2Bif+jq QEPsTb6sZp7eCtGmrwztzlgi7RRj7NBXG7n7RLyfwkibkT81NrXbLpmnxSXm4Dg6hQtX /nfNeFceJWj1cJTT3WCD9zIOjSz6OmLQ2MUdQ= 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=ISauC6bYaygEYzgQSfhd4oQxPoMw3Jqoh2mI+fApQWg=; b=SebmsP+AVJ1kZrbP9L/jHPsTwaxBqgZ6sHD7ShnwVCM7DesFhA7kpztdn0JotYKtTN wHoi7JsEZTTTJfBbx5we4SjaxLnIiE19IK47l1iWyOsqWhnnAhPuq6mEYwFiyZRrzouh CknMIhSt3Z30WHxnfRBLnqTjADlnBoIQewImYkQ+OSNHDyTIPE2ukqh7eaMRSiivYh6S pm/OAN0D/o8Ekt5cWkZJPdPRQgE/QW4IKVgLVRx/vf1/zWMCDUcQWWjp1Tfgqlx75L3p ucTOwT9z0MeP5UDFrRkZgh/XKoAYQ/C3+Qw93/aUvJSd2kXwGSiZTEfV0vgFlurGR/gk TsbA== X-Gm-Message-State: AG10YOQI77McijL+7nVzpBzDM/B/9R/PpAmNhGiuF/DGEV91UvQwOSfdBjeCtanPy9yIHFxZ X-Received: by 10.28.6.139 with SMTP id 133mr19483599wmg.84.1455209290764; Thu, 11 Feb 2016 08:48:10 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id g1sm3673798wmc.0.2016.02.11.08.48.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Feb 2016 08:48:10 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, laurentiu.tudor@nxp.com Subject: [PATCH v2 1/3] of/fdt: factor out assignment of initrd_start/initrd_end Date: Thu, 11 Feb 2016 17:48:00 +0100 Message-Id: <1455209282-9596-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455209282-9596-1-git-send-email-ard.biesheuvel@linaro.org> References: <1455209282-9596-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_084832_386219_EA548902 X-CRM114-Status: GOOD ( 11.53 ) 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:22e 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: 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. Signed-off-by: Ard Biesheuvel --- drivers/of/fdt.c | 12 +++++++++--- 1 file changed, 9 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..d1dd23127085 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -760,6 +760,14 @@ const void * __init of_flat_dt_match_machine(const void *default_match, } #ifdef CONFIG_BLK_DEV_INITRD +void __weak __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; +} + /** * early_init_dt_check_for_initrd - Decode initrd location from flat tree * @node: reference to node containing initrd location ('chosen') @@ -782,9 +790,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);