From patchwork Mon Nov 5 22:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993429 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n8UHNrfi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hX90kwsC"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp4x5nhVz9sCs for ; Tue, 6 Nov 2018 09:58:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qn1It7h6ty6EBN2txOcNg61jcDWKqvs+6hAQCCXhXs8=; b=n8UHNrfiIG5sApQTXfCea1pATD 5hZQhfsXa9viBy+9DtfjKNkyNIXtGqnl79Yz9X+f0ICtwEns4CjwDBt9WafvSecWbRQ26vYS+NlQ1 RNjJBisZ2PoMENrQ8O3KDKWcPnd+kODgLQRokTXqpXWqc0YFIXQm2mxt+irLqM5b8MQsk9Z7YKIZ6 wP7BB+et0zuLMZP1O132f1sv957SNNfOqdxh39NushbKXg4INc2z7PQccRgow+8RTT4zb1Fl5jOW2 UR++0cOCz35jgOZLxDs4YpVAde6WCZabOhw26joyv90/kJ8RpBlHU09a5LGq3PBF4ulbdgUvS3Ljz KKOoGG8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnpP-0000Km-ES; Mon, 05 Nov 2018 22:58:39 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnoq-0008E7-4Q; Mon, 05 Nov 2018 22:58:05 +0000 Received: by mail-pf1-x441.google.com with SMTP id v68-v6so1550467pfk.0; Mon, 05 Nov 2018 14:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VgNBTYXASvfvE5mN9VACuM5/lb+HR+nsTuMb/S+Z/g0=; b=hX90kwsCj0yrKIiMpZ7BbzUgcA+09UE+Q/W4vNMR20kYsZWoZMckYJyv7JHqrWnt0h yiicjwp2yWUN58TjC2wljlRC3YWfEdFxOutYgImI+8pt/4Y4YuMzhAUuVKrnl1lMu7DO m45W+18SbXGuIVsv6Be/vpptqn/ZWEmPpEoEcFz889hRt5PFxmw+AGVY/m/jdu0FbK4/ u/xI9ymccah/ZWD1atE+pQEpk8Xcu+j05VACYam/a1Y3eU5xUcpR6iyeXrp1GaBYSReJ sKSJZydJheJlVTo2LdUpp2V8JCXTFGiKWN/0OIDKbcxHf1CqDd9BHoQpf1L/4ods89vk 8BJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VgNBTYXASvfvE5mN9VACuM5/lb+HR+nsTuMb/S+Z/g0=; b=NTuQQf70VKZoAwMNYStDiOln4615GJesxJpPbNlXGwaYLzR8+939YbEFykVlsi6nnm pW0vIif/DVY7pBhG4mJKyTqvO2q2P8weEyaOumMWJd9g2EV4MPg6Gcria+Xcd0Jmfr+i ctiF304KsNGtg+Hz1xmZq5iq8OwmoAe9UDaadoLb/YnVVGc/5rvw2irj7xBrwl8OUis2 R57XUdR/EoUFvFynW4Ai8nVqRBQ0SR8oLfAz19aHaF2WLk/rYmGCim4ermFqrdoB/9xf QYd6yB7PELELTJ8mr/g+hdjn+tS9ex9K/w3p6pUTiAghfUDfwSFElPoph0IN8PP54Li9 tUdg== X-Gm-Message-State: AGRZ1gJ2gpWX19a85L0ITo1RXbT9L3BO5XJmFg4foWuNVwxc6fkGctfy 4yuTUEXnVcALL+4wAFcYQyY= X-Google-Smtp-Source: AJdET5flPEUVa4DTrqrXuVeEonToqM7dth/czamRdKp+dc9s1CxfO+MpVIQ0+sNqncZFvhfk1QHf8Q== X-Received: by 2002:a63:ec12:: with SMTP id j18mr19677663pgh.200.1541458681454; Mon, 05 Nov 2018 14:58:01 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.57.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:58:00 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 3/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT Date: Mon, 5 Nov 2018 14:54:28 -0800 Message-Id: <20181105225431.24485-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145804_203503_E5AC69BF X-CRM114-Status: GOOD ( 12.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -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_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that we have central and global variables holding the physical address and size of the initrd, we can have early_init_dt_check_for_initrd() populate phys_initrd_start/phys_initrd_size for us. This allows us to remove a chunk of code from arch/arm/mm/init.c introduced with commit 65939301acdb ("arm: set initrd_start/initrd_end for fdt scan"). Signed-off-by: Florian Fainelli --- arch/arm/mm/init.c | 6 ------ drivers/of/fdt.c | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 438625764ccd..a3b6f1f1cbaf 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -235,12 +235,6 @@ static void __init arm_initrd_init(void) phys_addr_t start; unsigned long size; - /* FDT scan will populate initrd_start */ - if (initrd_start && !phys_initrd_size) { - phys_initrd_start = __virt_to_phys(initrd_start); - phys_initrd_size = initrd_end - initrd_start; - } - initrd_start = initrd_end = 0; if (!phys_initrd_size) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index bb532aae0d92..88760a0983a7 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -924,6 +924,8 @@ static void __init early_init_dt_check_for_initrd(unsigned long node) end = of_read_number(prop, len/4); __early_init_dt_declare_initrd(start, end); + phys_initrd_start = start; + phys_initrd_size = end - start; pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", (unsigned long long)start, (unsigned long long)end);