linux-mips
[Top] [All Lists]

Re: [PATCH 04/14] MIPS: Add helper function to allow platforms to point

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH 04/14] MIPS: Add helper function to allow platforms to point at a DTB.
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Tue, 01 May 2012 02:58:53 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-reply-to: <1335785589-32532-4-git-send-email-blogic@openwrt.org>
References: <1335785589-32532-1-git-send-email-blogic@openwrt.org> <1335785589-32532-4-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120420 Thunderbird/12.0
Hello.

On 30-04-2012 15:32, John Crispin wrote:

Add __dt_setup_arch() that can be called to load a builtin DT.
Additionally we add a macro to allow loading a specific symbol
from the __dtb_* section.

Signed-off-by: Ralf Baechle<ralf@linux-mips.org>
Signed-off-by: John Crispin<blogic@openwrt.org>
---
  arch/mips/include/asm/prom.h |   11 +++++++++++
  arch/mips/kernel/prom.c      |   14 ++++++++++++++
  2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 558b539..271ad98 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -95,3 +95,17 @@ void __init device_tree_init(void)
        /* free the space reserved for the dt blob */
        free_mem_mach(base, size);
  }
+
+void __init __dt_setup_arch(struct boot_param_header *bph)
+{
+       unsigned long size;
+
+       if (be32_to_cpu(bph->magic) != OF_DT_HEADER) {
+               pr_err("DTB has bad magic, ignoring builtin OF DTB\n");
+
+               return;
+       }
+
+       initial_boot_params = bph;
+       size = be32_to_cpu(bph->totalsize);

   'size' only assigned, not used.

+}

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 04/14] MIPS: Add helper function to allow platforms to point at a DTB., Sergei Shtylyov <=