Skip to content

Commit

Permalink
MIPS: ralink: allow manual memory override
Browse files Browse the repository at this point in the history
RT5350 relies on the bootloader setting up the memc correctly. On some boards
the setup is incorrect leading to 32 MB being available but only 16 MB being
recognized. Allow these boards to manually override the memory range.

Signed-off-by: John Crispin <[email protected]>
Patchwork: http://patchwork.linux-mips.org/patch/8004/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
John Crispin authored and ralfbaechle committed Nov 24, 2014
1 parent 5433acd commit 15d1112
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion arch/mips/ralink/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ void __init device_tree_init(void)
unflatten_and_copy_device_tree();
}

static int memory_dtb;

static int __init early_init_dt_find_memory(unsigned long node,
const char *uname, int depth, void *data)
{
if (depth == 1 && !strcmp(uname, "memory@0"))
memory_dtb = 1;

return 0;
}

void __init plat_mem_setup(void)
{
set_io_port_base(KSEG1);
Expand All @@ -63,7 +74,10 @@ void __init plat_mem_setup(void)
*/
__dt_setup_arch(__dtb_start);

if (soc_info.mem_size)
of_scan_flat_dt(early_init_dt_find_memory, NULL);
if (memory_dtb)
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
else if (soc_info.mem_size)
add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
BOOT_MEM_RAM);
else
Expand Down

0 comments on commit 15d1112

Please sign in to comment.