All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Wolf <dev-NTEO@vplace.de>
To: linux-mips@linux-mips.org
Subject: [PATCH 1/2 v2] ralink: Introduce fw_passed_dtb to arch/mips/ralink
Date: Tue, 13 Dec 2016 11:46:41 +0100	[thread overview]
Message-ID: <1602859.QGKdh4otrC@loki> (raw)
In-Reply-To: <3700342.djbc9u0nWG@loki>

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>
---
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -66,13 +66,21 @@
 
 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)

---
This version has been cleaned up based on feedback [1] of John Crispin for the 
LEDE Project.

[1] https://github.com/lede-project/source/pull/582#discussion_r90778573

Best regards
Tobias

  parent reply	other threads:[~2016-12-13 10:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3700342.djbc9u0nWG@loki>
2016-11-21 16:22 ` [PATCH 1/2] ralink: Introduce fw_passed_dtb to arch/mips/ralink Tobias Wolf
     [not found] ` <2966402.rBqcQZDeOh@loki>
2016-11-21 16:23   ` [PATCH 2/2] of: Add check to of_scan_flat_dt() before accessing initial_boot_params Tobias Wolf
2016-11-21 17:21     ` Sergei Shtylyov
2016-11-21 17:35       ` Tobias Wolf
2016-11-23  6:11       ` [PATCH 2/2 v2] " Tobias Wolf
2016-11-23  8:47         ` Sergei Shtylyov
2016-11-23  9:40           ` [PATCH 2/2 v3] " Tobias Wolf
2016-12-13 10:46 ` Tobias Wolf [this message]
2016-12-13 22:40   ` [PATCH 1/2 v2] ralink: Introduce fw_passed_dtb to arch/mips/ralink John Crispin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1602859.QGKdh4otrC@loki \
    --to=dev-nteo@vplace.de \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.