summaryrefslogtreecommitdiff
path: root/arch/mips/ralink
diff options
context:
space:
mode:
authorTobias Wolf <dev-NTEO@vplace.de>2016-12-13 11:46:41 +0100
committerRalf Baechle <ralf@linux-mips.org>2017-01-03 16:34:43 +0100
commit02564fc89d3d92a8d4fa6e11c348000b70e9568d (patch)
tree84cb049b0e40a0a19ea7f5662639654a1cf66f79 /arch/mips/ralink
parent5e73ad3ffcebc72bce9a662d3e59f0cc9fb3f4ef (diff)
ralink: Introduce fw_passed_dtb to arch/mips/ralink
This patch adds fw_passed_dtb to arch/mips/ralink to support CONFIG_MIPS_RAW_APPENDED_DTB. Furthermore it adds a check that __dtb_start is not the same address as __dtb_end. Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de> Acked-by: John Crispin <john@phrozen.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14662/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ralink')
-rw-r--r--arch/mips/ralink/of.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 0aa67a2d0ae6..4c843e039b96 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -66,13 +66,21 @@ static int __init early_init_dt_find_memory(unsigned long node,
void __init plat_mem_setup(void)
{
+ void *dtb = NULL;
+
set_io_port_base(KSEG1);
/*
* Load the builtin devicetree. This causes the chosen node to be
- * parsed resulting in our memory appearing
+ * parsed resulting in our memory appearing. fw_passed_dtb is used
+ * by CONFIG_MIPS_APPENDED_RAW_DTB as well.
*/
- __dt_setup_arch(__dtb_start);
+ if (fw_passed_dtb)
+ dtb = (void *)fw_passed_dtb;
+ else if (__dtb_start != __dtb_end)
+ dtb = (void *)__dtb_start;
+
+ __dt_setup_arch(dtb);
of_scan_flat_dt(early_init_dt_find_memory, NULL);
if (memory_dtb)