Commit b1ab95c6 authored by Florian Fainelli's avatar Florian Fainelli Committed by Rob Herring

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent cd5e0fa0
...@@ -50,9 +50,7 @@ unsigned long __init __clear_cr(unsigned long mask) ...@@ -50,9 +50,7 @@ unsigned long __init __clear_cr(unsigned long mask)
} }
#endif #endif
static phys_addr_t phys_initrd_start __initdata = 0; #ifdef CONFIG_BLK_DEV_INITRD
static unsigned long phys_initrd_size __initdata = 0;
static int __init early_initrd(char *p) static int __init early_initrd(char *p)
{ {
phys_addr_t start; phys_addr_t start;
...@@ -89,6 +87,7 @@ static int __init parse_tag_initrd2(const struct tag *tag) ...@@ -89,6 +87,7 @@ static int __init parse_tag_initrd2(const struct tag *tag)
} }
__tagtable(ATAG_INITRD2, parse_tag_initrd2); __tagtable(ATAG_INITRD2, parse_tag_initrd2);
#endif
static void __init find_limits(unsigned long *min, unsigned long *max_low, static void __init find_limits(unsigned long *min, unsigned long *max_low,
unsigned long *max_high) unsigned long *max_high)
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include "mm.h" #include "mm.h"
static unsigned long phys_initrd_start __initdata = 0x01000000; #ifdef CONFIG_BLK_DEV_INITRD
static unsigned long phys_initrd_size __initdata = SZ_8M;
static int __init early_initrd(char *p) static int __init early_initrd(char *p)
{ {
unsigned long start, size; unsigned long start, size;
...@@ -48,6 +46,7 @@ static int __init early_initrd(char *p) ...@@ -48,6 +46,7 @@ static int __init early_initrd(char *p)
return 0; return 0;
} }
early_param("initrd", early_initrd); early_param("initrd", early_initrd);
#endif
/* /*
* This keeps memory configuration data used by a couple memory * This keeps memory configuration data used by a couple memory
...@@ -156,6 +155,11 @@ void __init uc32_memblock_init(struct meminfo *mi) ...@@ -156,6 +155,11 @@ void __init uc32_memblock_init(struct meminfo *mi)
memblock_reserve(__pa(_text), _end - _text); memblock_reserve(__pa(_text), _end - _text);
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (!phys_initrd_size) {
phys_initrd_start = 0x01000000;
phys_initrd_size = SZ_8M;
}
if (phys_initrd_size) { if (phys_initrd_size) {
memblock_reserve(phys_initrd_start, phys_initrd_size); memblock_reserve(phys_initrd_start, phys_initrd_size);
......
...@@ -21,4 +21,7 @@ extern int initrd_below_start_ok; ...@@ -21,4 +21,7 @@ extern int initrd_below_start_ok;
extern unsigned long initrd_start, initrd_end; extern unsigned long initrd_start, initrd_end;
extern void free_initrd_mem(unsigned long, unsigned long); 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; extern unsigned int real_root_dev;
...@@ -16,6 +16,9 @@ int initrd_below_start_ok; ...@@ -16,6 +16,9 @@ int initrd_below_start_ok;
unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */
static int __initdata mount_initrd = 1; 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) static int __init no_initrd(char *str)
{ {
mount_initrd = 0; mount_initrd = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment