aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-04-15 05:45:09 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-05-07 19:19:12 -0400
commit9b75733b7b5e056a893f829262c2a2624a66d186 (patch)
tree4ea117284ad1ff2e1065d70b6797d1988678702d /arch/mips
parentdd63b00804a5c842fb73b6afc52f928f0c209a07 (diff)
MIPS: ath79: make use of the new memory detection code
There is now a generic function for detecting memory size. Use this instead of the one found in the ath79 support. Signed-off-by: John Crispin <blogic@openwrt.org> Acked-by: Gabor Juhos <juhosg@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/5149/
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/ath79/setup.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index d5b3c9057018..a0233a2c1988 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -51,20 +51,6 @@ static void ath79_halt(void)
51 cpu_wait(); 51 cpu_wait();
52} 52}
53 53
54static void __init ath79_detect_mem_size(void)
55{
56 unsigned long size;
57
58 for (size = ATH79_MEM_SIZE_MIN; size < ATH79_MEM_SIZE_MAX;
59 size <<= 1) {
60 if (!memcmp(ath79_detect_mem_size,
61 ath79_detect_mem_size + size, 1024))
62 break;
63 }
64
65 add_memory_region(0, size, BOOT_MEM_RAM);
66}
67
68static void __init ath79_detect_sys_type(void) 54static void __init ath79_detect_sys_type(void)
69{ 55{
70 char *chip = "????"; 56 char *chip = "????";
@@ -212,7 +198,7 @@ void __init plat_mem_setup(void)
212 AR71XX_DDR_CTRL_SIZE); 198 AR71XX_DDR_CTRL_SIZE);
213 199
214 ath79_detect_sys_type(); 200 ath79_detect_sys_type();
215 ath79_detect_mem_size(); 201 detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
216 ath79_clocks_init(); 202 ath79_clocks_init();
217 203
218 _machine_restart = ath79_restart; 204 _machine_restart = ath79_restart;