diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2019-08-19 10:23:09 -0400 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-08-23 09:47:16 -0400 |
commit | b3c948e2c00f561b22a9865a9b9b952072973285 (patch) | |
tree | 73fe09bbc6a95e21d99641ba6dce5080123228d2 | |
parent | 79fd0fe44731188054b6f4c433b5f805217a396c (diff) |
MIPS: msp: Record prom memory
boot_mem_map is nolonger exist so we need to maintain a list
of prom memory by ourselves
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: yasha.che3@gmail.com
Cc: aurelien@aurel32.net
Cc: sfr@canb.auug.org.au
Cc: fancer.lancer@gmail.com
Cc: matt.redfearn@mips.com
Cc: chenhc@lemote.com
-rw-r--r-- | arch/mips/pmcs-msp71xx/msp_prom.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/mips/pmcs-msp71xx/msp_prom.c b/arch/mips/pmcs-msp71xx/msp_prom.c index 6fdcb3d6fbb5..dfb527961a27 100644 --- a/arch/mips/pmcs-msp71xx/msp_prom.c +++ b/arch/mips/pmcs-msp71xx/msp_prom.c | |||
@@ -61,6 +61,10 @@ int init_debug = 1; | |||
61 | /* memory blocks */ | 61 | /* memory blocks */ |
62 | struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS]; | 62 | struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS]; |
63 | 63 | ||
64 | static phys_addr_t prom_mem_base[MAX_PROM_MEM] __initdata; | ||
65 | static phys_addr_t prom_mem_size[MAX_PROM_MEM] __initdata; | ||
66 | static unsigned int nr_prom_mem __initdata; | ||
67 | |||
64 | /* default feature sets */ | 68 | /* default feature sets */ |
65 | static char msp_default_features[] = | 69 | static char msp_default_features[] = |
66 | #if defined(CONFIG_PMC_MSP4200_EVAL) \ | 70 | #if defined(CONFIG_PMC_MSP4200_EVAL) \ |
@@ -352,6 +356,16 @@ void __init prom_meminit(void) | |||
352 | 356 | ||
353 | add_memory_region(base, size, type); | 357 | add_memory_region(base, size, type); |
354 | p++; | 358 | p++; |
359 | |||
360 | if (type == BOOT_MEM_ROM_DATA) { | ||
361 | if (nr_prom_mem >= 5) { | ||
362 | pr_err("Too many ROM DATA regions"); | ||
363 | continue; | ||
364 | } | ||
365 | prom_mem_base[nr_prom_mem] = base; | ||
366 | prom_mem_size[nr_prom_mem] = size; | ||
367 | nr_prom_mem++; | ||
368 | } | ||
355 | } | 369 | } |
356 | } | 370 | } |
357 | 371 | ||
@@ -407,13 +421,9 @@ void __init prom_free_prom_memory(void) | |||
407 | envp[i] = NULL; /* end array with null pointer */ | 421 | envp[i] = NULL; /* end array with null pointer */ |
408 | prom_envp = envp; | 422 | prom_envp = envp; |
409 | 423 | ||
410 | for (i = 0; i < boot_mem_map.nr_map; i++) { | 424 | for (i = 0; i < nr_prom_mem; i++) { |
411 | if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA) | ||
412 | continue; | ||
413 | |||
414 | addr = boot_mem_map.map[i].addr; | ||
415 | free_init_pages("prom memory", | 425 | free_init_pages("prom memory", |
416 | addr, addr + boot_mem_map.map[i].size); | 426 | prom_mem_base[i], prom_mem_base[i] + prom_mem_size[i]); |
417 | } | 427 | } |
418 | } | 428 | } |
419 | 429 | ||