aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-11-05 14:54:27 -0800
committerRob Herring <robh@kernel.org>2018-11-26 15:50:02 -0600
commitb1ab95c63622e9d9bd0ce685e149034d393afc2e (patch)
tree35fd6535f0b8c6934fb86b86754d300c6d7898f8 /arch/unicore32
parentnds32: Remove phys_initrd_start and phys_initrd_size (diff)
downloadlinux-dev-b1ab95c63622e9d9bd0ce685e149034d393afc2e.tar.xz
linux-dev-b1ab95c63622e9d9bd0ce685e149034d393afc2e.zip
arch: Make phys_initrd_start and phys_initrd_size global variables
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 <f.fainelli@gmail.com> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'arch/unicore32')
-rw-r--r--arch/unicore32/mm/init.c10
1 files changed, 7 insertions, 3 deletions
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);