From patchwork Tue Oct 30 23:07:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 991178 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="PGXRQDD4"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pekoUhWp"; 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 42l6hD4278z9s8r for ; Wed, 31 Oct 2018 10:13:00 +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=S/YLtlbmrT42YrYRo6xhjK6ac49whKTzEak1e6U8J3U=; b=PGXRQDD4yfz7hsJZyJuuMqKBgm 1pOwklsviwMuOpMxP+Ydehcuuq2KldkWtrcn1xw57Bzdt+pdl2/Xj2VLwJOJQNiJ5NDURDR+uKzzE MtVLT5ZH5xk+K7CRXPODgLQKmra96tpaDS98LULd/oR1K4dxrgljv9HxyC3UF1T/DVqUZPxYzq2Fw BOVfIKZjeArpV1XWuPnUEo0aLadF2KSZMyqUbzWzGLWTZjnTsyGeY4OcjejPCDOTJkoKGgEOyVfkW kgX2LTfuHVmqlCzXfyJF55+IGZe+ASFAL8c5gP7wnIohceqx5Krb3ZU6a+3SPQkRR9bAVMqntS5yv dVtVN9YQ==; 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 1gHdBy-0006NU-Iz; Tue, 30 Oct 2018 23:12:58 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHd74-0002wO-WB; Tue, 30 Oct 2018 23:07:56 +0000 Received: by mail-pf1-x442.google.com with SMTP id h4-v6so6599631pfi.10; Tue, 30 Oct 2018 16:07:52 -0700 (PDT) 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=7tZFK7bYGAH6azDS0jVMH4AjaPmsUCiqxVsDGGft9WU=; b=pekoUhWp8L+hjF7Ch1fACgCku/k3gVF4ZdZg0wCG8M1BpHpxZB3YKfTWnYSA00mzzx Tp3zcbLWvGFbO+7CIruB1A1KqN1tnbanZV2xExwvM2c7lbDUcohQVV1ESRfpiG6diGSU IwE/rr2hVUQ4LVciwznpwYV0JKu60fDKR8jwAa4F2L9fAWVB+RgNLqUKwyI0VKc1Za92 wJuAcp2Gq1SeJW+5vtxd5810zg4VxYMLAK/NthpnkNCK7eoTfiz407wdTI94kthWhvvl zOcj70EhzIJIkx6X2srInTDIPe7Xt0nLvM+XsMjpKlFtpAbLAwAyRL0tMwaJuywkBpyH pNDA== 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=7tZFK7bYGAH6azDS0jVMH4AjaPmsUCiqxVsDGGft9WU=; b=pqmbkvbvTw3F4yIVWd1JqD45AopWzRpteZupWYbA100s1+8EDAKEK/y2EbUFv3lhmE yrjTrwF5Mn95Iall4z+gq+98P1hDfa3pe4/mzITAQl/7nrL6m//lMfpqCUUREaBHRN0o eF9wcW0g4qOvrfETe9xoaRG2jzSwO1ruygCuBfYORXvP09e2lCJozC93noVwa8jJkUv6 B7JONpjQlRV1ARsuB+0LnNopgSCPydVt/Sh83F/1bTcs4nfzi/p0X70yS4ewh7uYuZnN NzobaxtW3fLwHOe52VphLla1D+2ZngcQ7PHQ/1Mu1CU7Vv0MPm8EG98dz5hwKnPe6Fe3 ndjQ== X-Gm-Message-State: AGRZ1gKOMXxC310l6fL+ETgEtly77a2sFan7Q5ldSJFz4XUM6h4oh84F maqjOr83MU2iUcxIYOwnS1c= X-Google-Smtp-Source: AJdET5eCk0WV+MPNK6/Jjx0WrYAmBBB7IOwp4iC4TbQysw7UuDUgKHgTAoN9+UKJfx1XTHpyn9v7gA== X-Received: by 2002:a63:8ac4:: with SMTP id y187mr668872pgd.446.1540940871337; Tue, 30 Oct 2018 16:07:51 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id f14-v6sm3431689pgr.87.2018.10.30.16.07.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 16:07:50 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT Date: Tue, 30 Oct 2018 16:07:18 -0700 Message-Id: <20181030230721.28429-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181030230721.28429-1-f.fainelli@gmail.com> References: <20181030230721.28429-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_160755_040572_C481CD96 X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 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:442 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 Message has at least one valid DKIM or DK signature -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 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 87d59a53861d..4bfa08e27319 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -236,12 +236,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 76c83c1ffeda..e34cb49231b5 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -925,6 +925,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);