From patchwork Wed Oct 31 19:28:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 991670 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="Nw7rLJWm"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D0UGJxw3"; 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 42ldhT6rk6z9sDP for ; Thu, 1 Nov 2018 06:30:01 +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=gdkzaUVKMYaRBmExgIyNMbufZS8ad+xumyK/aiygxMg=; b=Nw7rLJWmG9Uz/5Sm4BXdu1LeFB hA6z8qtnI01ejMtRkVl2bLWFe76ih+hFU53tGGAIJFad8UvARiO1OInp7BnGruWFWKbCK2twZpQRF 2K0dvFoBXRgQHl4zelujHbEvQXDlAc92kqexQqCP8L/1yuH3a218lo5bZ0MfvvvWylMD+RwZFJVAy yMbmqDEkO3tACHWswOsEO/divj2IZjThKJD74tfZO2iuUWliTpy/KkFktnP1vlm3zGv/qor2v84pu hEks2BtFBlv1WgV2XVO4lMNNPmxn/ba6GB7zcXNNChEJrK1reYbTD5QBrUDCL+o+VDFM6YuNfayWs 2+t0Ce+w==; 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 1gHwBi-0000k8-Ts; Wed, 31 Oct 2018 19:29:58 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHwB9-0008Nk-AY; Wed, 31 Oct 2018 19:29:28 +0000 Received: by mail-pg1-x542.google.com with SMTP id i4-v6so7843119pgq.9; Wed, 31 Oct 2018 12:29:12 -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=Nke71ZtNfiPXWX+lqnx2jsJDUBi6cIRk7Gj2+Ze+5Dk=; b=D0UGJxw3IGuKJzlh+u4+fs2s7gNUwg8fQuGu1ip5JsGEqMxKoquGfU+ihR2eJ3LBMv zZ5PrRZdKm714Sjb0mtalmZeVSoaTRyhml3lZ9e7sGe/uGt+PD0zG1NpZD+8w8qaqTP4 RS+WH28jKMN6W6gaszDpwGisAJYSekv85TE9EHtqGBpFlHQBfFZhNUAvfFihAO+YC/za 393UONZWP7dwZTUD8eyp7lmjWXaGljzlapCkgqyMQXekjHtNrdOX4f7dQAG2JW/+pFTK 3j+k4ORwjzwTCo/8RVJnhwLDKoEIkhsVbsoEKQMeH6ICmnlQ1S5T4PWymEyUl42NWf8v G3kQ== 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=Nke71ZtNfiPXWX+lqnx2jsJDUBi6cIRk7Gj2+Ze+5Dk=; b=I8sbx6YcYb2xB0lQWlmxNI/9arUOO9HG4Yo/InjmLGcmQ8X0TinFVK/poDmuxb1AvW fqJQsMdsXETKZUCLBezSbK+ewNIu7iNBJEaAAc8owNWdggnyfdmI2XEAUFJ6cxJJ0ou7 +1qpXd5B1ov1DsN7PfpXSVCTrf57+Rpo5yCIyN5Da5+ozFqg8NVaUgfIvSljZh3SM4Ex LKno5+50bAQn5Bw8LcQReXz2a4iG/5lyMPIFtMRiOk1OeI2Uxa85HMGjglFqNMqHCwa+ 1+k31w9k6OJRhWfw1wZkAp/KvIb9m9sBvE16f3v5YPTsqSmxRc3MS9tl9C2qd7u0CSHD r8cA== X-Gm-Message-State: AGRZ1gJ3il6bOv0js4GuowNAR7/jY+qwYEZjejfJW+UTX/cXvgoeQZnR 1Yo3TOs9+EIhG8QokOICKnM= X-Google-Smtp-Source: AJdET5dzBHnEWkvmunA1zp0PYTlyCqOoDYDKWzefUTAi4zGUGEXmQiPQZ5/ZX7frYGKPK/LF0uLSyg== X-Received: by 2002:a63:344e:: with SMTP id b75mr4264890pga.184.1541014152169; Wed, 31 Oct 2018 12:29:12 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id z26-v6sm28926456pfh.77.2018.10.31.12.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 12:29:11 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v3 2/6] arch: Make phys_initrd_start and phys_initrd_size global variables Date: Wed, 31 Oct 2018 12:28:39 -0700 Message-Id: <20181031192843.13230-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031192843.13230-1-f.fainelli@gmail.com> References: <20181031192843.13230-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181031_122923_658108_A377CCEC X-CRM114-Status: GOOD ( 14.82 ) 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:542 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_EF Message has a valid DKIM or DK signature from envelope-from domain -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 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 Make phys_initrd_start and phys_initrd_size global variables declared in init/do_mounts_initrd.c such that we can later have generic code in drivers/of/fdt.c populate those variables for us. This requires both the ARM and unicore32 implementations to be properly guarded against CONFIG_BLK_DEV_INITRD, and also initialize the variables to the expected default values (unicore32). Signed-off-by: Florian Fainelli --- arch/arm/mm/init.c | 5 ++--- arch/unicore32/mm/init.c | 10 +++++++--- include/linux/initrd.h | 3 +++ init/do_mounts_initrd.c | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0cc8e04295a4..87d59a53861d 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -51,9 +51,7 @@ unsigned long __init __clear_cr(unsigned long mask) } #endif -static phys_addr_t phys_initrd_start __initdata = 0; -static unsigned long phys_initrd_size __initdata = 0; - +#ifdef CONFIG_BLK_DEV_INITRD static int __init early_initrd(char *p) { phys_addr_t start; @@ -90,6 +88,7 @@ static int __init parse_tag_initrd2(const struct tag *tag) } __tagtable(ATAG_INITRD2, parse_tag_initrd2); +#endif static void __init find_limits(unsigned long *min, unsigned long *max_low, unsigned long *max_high) diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index 8f8699e62bd5..f2f815d46846 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -31,9 +31,7 @@ #include "mm.h" -static unsigned long phys_initrd_start __initdata = 0x01000000; -static unsigned long phys_initrd_size __initdata = SZ_8M; - +#ifdef CONFIG_BLK_DEV_INITRD static int __init early_initrd(char *p) { unsigned long start, size; @@ -49,6 +47,7 @@ static int __init early_initrd(char *p) return 0; } early_param("initrd", early_initrd); +#endif /* * This keeps memory configuration data used by a couple memory @@ -157,6 +156,11 @@ void __init uc32_memblock_init(struct meminfo *mi) memblock_reserve(__pa(_text), _end - _text); #ifdef CONFIG_BLK_DEV_INITRD + if (!phys_initrd_size) { + phys_initrd_start = 0x01000000; + phys_initrd_size = SZ_8M; + } + if (phys_initrd_size) { memblock_reserve(phys_initrd_start, phys_initrd_size); diff --git a/include/linux/initrd.h b/include/linux/initrd.h index 84b423044088..14beaff9b445 100644 --- a/include/linux/initrd.h +++ b/include/linux/initrd.h @@ -21,4 +21,7 @@ extern int initrd_below_start_ok; extern unsigned long initrd_start, initrd_end; extern void free_initrd_mem(unsigned long, unsigned long); +extern phys_addr_t phys_initrd_start; +extern unsigned long phys_initrd_size; + extern unsigned int real_root_dev; diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index d1a5d885ce13..45865b72f4ea 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -16,6 +16,9 @@ int initrd_below_start_ok; unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ static int __initdata mount_initrd = 1; +phys_addr_t phys_initrd_start __initdata; +unsigned long phys_initrd_size __initdata; + static int __init no_initrd(char *str) { mount_initrd = 0;