Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1151791imu; Mon, 5 Nov 2018 14:59:21 -0800 (PST) X-Google-Smtp-Source: AJdET5dUEsjW7IF/ycxT7i6hST06F9haku9nke9KnnZZdEAioHURlCHU3zkmC4JL3ienZDVAXhbu X-Received: by 2002:a65:5a8e:: with SMTP id c14mr8162458pgt.137.1541458761498; Mon, 05 Nov 2018 14:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541458761; cv=none; d=google.com; s=arc-20160816; b=XkW8vgDFrBpNSTYK3bTD2u8TVJh3CZabyEgL9RqvFMJpwXajRwIWtZvL4N/ZHfXRmY XUbPTenzKnRtnQB6Tqt6XYVVnGp0illG9JLeHw5sBb+sL3HsqELu52xUnLGnAzyZ46qt ypOxxb0pRpjVfnNQYer/CvInyO9Ehh3kDTpsiUGffxhyv80NSK7mr0gApSVo9EEl2Ci7 CK/EF4EDxnKzvvkTmR8yypnMJpPOdrrUzkqr4ajIBuaYLHlqps0nSNK7F/5NxWxDHPer bTiUfoqvI961VEhdmxAGl1d8ncBOrC3SVOb0grgk1UIbKM/hhBnbRIUkPm//9gtPYBuj BMZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=c8Lf7boHwRJXjni27D65zHCfVda/tTM6oSDLxd215Cs=; b=SBEKfgSISiqSbDjLuMeyqJ92lWgeLvNJqQX3NjQyN7pl/vmbMOD4jL5vTcAx7kgoqQ xhblxhpG39lJrmgBjYBUQlNaYuCbcUmkiTWec7KLNhwhYJYZlVP3qGn2eS1Wz8AAlb16 p1rzZnyxZdAVmzM2h/Rwt8vRmXZYP5XSQE8vW2F5W6jOJ5EKI4x+AePvzGkoLwXE4+ZO ifTbVn7YDO1JRvM3YwrOy1dm+q4+/7cJpjiWAV3Vnge2aU4eTLlH0iWk9k7Ri6iUb+jO WJfG7a1QN6+pWr9xjUSIUraiAIMnn6Lvud5c65WXQvDp5RB1eADfQ7YMxUhUvmMAgi52 X85w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CyP0IHV4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si11461045pgc.220.2018.11.05.14.59.06; Mon, 05 Nov 2018 14:59:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CyP0IHV4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388301AbeKFIUD (ORCPT + 99 others); Tue, 6 Nov 2018 03:20:03 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:32884 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388034AbeKFIUC (ORCPT ); Tue, 6 Nov 2018 03:20:02 -0500 Received: by mail-pf1-f194.google.com with SMTP id v68-v6so1550436pfk.0; Mon, 05 Nov 2018 14:57:59 -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=c8Lf7boHwRJXjni27D65zHCfVda/tTM6oSDLxd215Cs=; b=CyP0IHV4UZ15O/1av2PxKPc3fsM1dB9agK8a5/x5JbPuU8ehNbg93f2Z+H3p8P3exi AUysi1kvzZ/nzXqIkehj9x3Ty4dTQW1tZ2GiD9b1pDhZZhcQLbJBYft327OsaDdMCnda Ok0lC9+RrISTA0Gm2gsdkCQnOQ5EZc7azgT+1N9GydyYITmsfSwncHRfXsaMSz2+uGvc L2a8wReRvETau5kwO0UB9OCTE1M0zy8aFm9wXpj4c1y1OZ7bQkajvflID0pJmpJR9ruu /fO+Un/RWygfM+tHMG3jsuuVW0Dgp6S4GjVs77Y0YVYmTEH8FuFEH3t8NvQ2Sx5fU3mJ b6Yg== 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=c8Lf7boHwRJXjni27D65zHCfVda/tTM6oSDLxd215Cs=; b=UhqtYdBSEs3dGdOFeDOV10JS/7OhfZ0FNAaibejgCg3ismdUevHlXFSAfqzNYju2xX nAgHtAxQrrUxbmzdZQNpuTxafLFV7CBDvFWabJb3G6VhV5e7nDmk2PoxnnIbGGJzAD6u aXFt7FCYOhPwSh0uxv1gmayYuTlNTDyM9UCC+9kXMJNoyYgdJCSlaBeLirpXO8M2HwLt HitZXmbdV2hd6/GGsXIq8WE/275orP1Uu5Unq89HVJPcqGbk/OPMMTkQFhqXGAKyCLFv fMqjjut+SINdTduCqk9FqvdnUvVFnugnQ+FXh+JBnu770Ain5xjAjrbQiVaztX2G30u0 CMgw== X-Gm-Message-State: AGRZ1gJYzU/f3c1KoJLw5lqt0iSEqU+6c+TD8txNZZcVJQfs/IdrwylO 6v5rpOMr2bF6FFh2nWGeENF36ysW X-Received: by 2002:a63:4c6:: with SMTP id 189mr21972247pge.391.1541458678847; Mon, 05 Nov 2018 14:57:58 -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.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:57:58 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Andrew Morton , Marc Zyngier , Russell King , Andrey Ryabinin , Andrey Konovalov , Masahiro Yamada , Robin Murphy , Laura Abbott , Stefan Agner , Johannes Weiner , Greg Hackmann , Kristina Martsenko , CHANDAN VN , linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE), rppt@linux.ibm.com, linux@armlinux.org.uk, green.hu@gmail.com, deanbo422@gmail.com, gxt@pku.edu.cn, ard.biesheuvel@linaro.org, linux-snps-arc@lists.infradead.org, vgupta@synopsys.com Subject: [PATCH v4 2/6] arch: Make phys_initrd_start and phys_initrd_size global variables Date: Mon, 5 Nov 2018 14:54:27 -0800 Message-Id: <20181105225431.24485-3-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 32e4845af2b6..438625764ccd 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -50,9 +50,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; @@ -89,6 +87,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 cf4eb9481fd6..02aa2c0b295e 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -30,9 +30,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; @@ -48,6 +46,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 @@ -156,6 +155,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; -- 2.17.1