diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-01-18 04:42:20 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-02-15 12:45:56 -0500 |
commit | 450dd430bf45ab212a91acfb9bed2528d17f30cd (patch) | |
tree | deaf7d7aef0616834e804de041eea9de3e0a52c8 /arch/arc/mm/init.c | |
parent | 999159a5381bff3bd6f688c5d20fbec9d8789e53 (diff) |
ARC: [DeviceTree] Convert some Kconfig items to runtime values
* mem size now runtime configured (prev CONFIG_ARC_PLAT_SDRAM_SIZE)
* core cpu clk runtime configured (prev CONFIG_ARC_PLAT_CLK)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arc/mm/init.c')
-rw-r--r-- | arch/arc/mm/init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index 682cf5740483..caf797de23fc 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c | |||
@@ -25,7 +25,7 @@ char empty_zero_page[PAGE_SIZE] __aligned(PAGE_SIZE); | |||
25 | EXPORT_SYMBOL(empty_zero_page); | 25 | EXPORT_SYMBOL(empty_zero_page); |
26 | 26 | ||
27 | /* Default tot mem from .config */ | 27 | /* Default tot mem from .config */ |
28 | static unsigned long arc_mem_sz = CONFIG_ARC_PLAT_SDRAM_SIZE; | 28 | static unsigned long arc_mem_sz = 0x20000000; /* some default */ |
29 | 29 | ||
30 | /* User can over-ride above with "mem=nnn[KkMm]" in cmdline */ | 30 | /* User can over-ride above with "mem=nnn[KkMm]" in cmdline */ |
31 | static int __init setup_mem_sz(char *str) | 31 | static int __init setup_mem_sz(char *str) |
@@ -41,7 +41,8 @@ early_param("mem", setup_mem_sz); | |||
41 | 41 | ||
42 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) | 42 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) |
43 | { | 43 | { |
44 | pr_err("%s(%llx, %llx)\n", __func__, base, size); | 44 | arc_mem_sz = size & PAGE_MASK; |
45 | pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz)); | ||
45 | } | 46 | } |
46 | 47 | ||
47 | /* | 48 | /* |
@@ -62,7 +63,9 @@ void __init setup_arch_memory(void) | |||
62 | 63 | ||
63 | /* | 64 | /* |
64 | * We do it here, so that memory is correctly instantiated | 65 | * We do it here, so that memory is correctly instantiated |
65 | * even if "mem=xxx" cmline over-ride is not given | 66 | * even if "mem=xxx" cmline over-ride is given and/or |
67 | * DT has memory node. Each causes an update to @arc_mem_sz | ||
68 | * and we finally add memory one here | ||
66 | */ | 69 | */ |
67 | memblock_add(CONFIG_LINUX_LINK_BASE, arc_mem_sz); | 70 | memblock_add(CONFIG_LINUX_LINK_BASE, arc_mem_sz); |
68 | 71 | ||