All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jayachandran C" <jayachandranc@netlogicmicro.com>
To: linux-mips@linux-mips.org, ralf@linux-mips.org
Cc: "Jayachandran C" <jayachandranc@netlogicmicro.com>
Subject: [PATCH 09/12] MIPS: Netlogic: Add support for built in DTB
Date: Fri, 13 Jul 2012 21:53:22 +0530	[thread overview]
Message-ID: <1342196605-4260-10-git-send-email-jayachandranc@netlogicmicro.com> (raw)
In-Reply-To: <1342196605-4260-1-git-send-email-jayachandranc@netlogicmicro.com>

Provide a config option to embed a device tree for XLP evaluation
boards. This DTB will be used if the firmware does not pass in a
device tree pointer.

Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com>
---
 arch/mips/Kconfig               |    1 +
 arch/mips/netlogic/Kconfig      |   15 +++++++++++++++
 arch/mips/netlogic/Makefile     |    1 +
 arch/mips/netlogic/dts/Makefile |    4 ++++
 arch/mips/netlogic/xlp/setup.c  |   12 +++++++++++-
 5 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/netlogic/dts/Makefile

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 61e1459..d80ed42 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -827,6 +827,7 @@ config NLM_XLP_BOARD
 	select ZONE_DMA if 64BIT
 	select SYNC_R4K
 	select SYS_HAS_EARLY_PRINTK
+	select USE_OF
 	help
 	  This board is based on Netlogic XLP Processor.
 	  Say Y here if you have a XLP based board.
diff --git a/arch/mips/netlogic/Kconfig b/arch/mips/netlogic/Kconfig
index 75bec44..8059eb7 100644
--- a/arch/mips/netlogic/Kconfig
+++ b/arch/mips/netlogic/Kconfig
@@ -1,2 +1,17 @@
+if NLM_XLP_BOARD || NLM_XLR_BOARD
+
+if NLM_XLP_BOARD
+config DT_XLP_EVP
+	bool "Built-in device tree for XLP EVP/SVP boards"
+	default y
+	help
+	  Add an FDT blob for XLP EVP and SVP boards into the kernel.
+	  This DTB will be used if the firmware does not pass in a DTB
+          pointer to the kernel.  The corresponding DTS file is at
+          arch/mips/netlogic/dts/xlp_evp.dts
+endif
+
 config NLM_COMMON
 	bool
+
+endif
diff --git a/arch/mips/netlogic/Makefile b/arch/mips/netlogic/Makefile
index 36d169b..7602d13 100644
--- a/arch/mips/netlogic/Makefile
+++ b/arch/mips/netlogic/Makefile
@@ -1,3 +1,4 @@
 obj-$(CONFIG_NLM_COMMON)	+=	common/
 obj-$(CONFIG_CPU_XLR)		+=	xlr/
 obj-$(CONFIG_CPU_XLP)		+=	xlp/
+obj-$(CONFIG_CPU_XLP)		+=	dts/
diff --git a/arch/mips/netlogic/dts/Makefile b/arch/mips/netlogic/dts/Makefile
new file mode 100644
index 0000000..67ae3fe
--- /dev/null
+++ b/arch/mips/netlogic/dts/Makefile
@@ -0,0 +1,4 @@
+obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o
+
+$(obj)/%.dtb: $(obj)/%.dts
+	$(call if_changed,dtc)
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 0d2d679..d899709 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -57,6 +57,7 @@ unsigned long nlm_common_ebase = 0x0;
 /* default to uniprocessor */
 uint32_t nlm_coremask = 1, nlm_cpumask  = 1;
 int  nlm_threads_per_core = 1;
+extern u32 __dtb_start[];
 
 static void nlm_linux_exit(void)
 {
@@ -97,9 +98,18 @@ void __init prom_init(void)
 {
 	void *fdtp;
 
-	fdtp = (void *)(long)fw_arg0;
 	xlp_mmu_init();
 	nlm_hal_init();
+
+	/*
+	 * If no FDT pointer is passed in, use the built-in FDT.
+	 * device_tree_init() does not handle CKSEG0 pointers in
+	 * 64-bit, so convert pointer.
+	 */
+	fdtp = (void *)(long)fw_arg0;
+	if (!fdtp)
+		fdtp = __dtb_start;
+	fdtp = phys_to_virt(__pa(fdtp));
 	early_init_devtree(fdtp);
 
 	nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
-- 
1.7.9.5

  parent reply	other threads:[~2012-07-13 16:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 16:23 [PATCH 00/12] Netlogic XLR/XLP updates Jayachandran C
2012-07-13 16:23 ` [PATCH 01/12] MIPS: Netlogic: Fix indentation of smpboot.S Jayachandran C
2012-07-13 16:23 ` [PATCH 02/12] MIPS: Netlogic: Fix low-level flush on core wakeup Jayachandran C
2012-07-24 14:59   ` Ralf Baechle
2012-07-13 16:23 ` [PATCH 03/12] MIPS: Netlogic: merge of.c into setup.c Jayachandran C
2012-07-13 16:23 ` [PATCH 04/12] MIPS: Netlogic: remove cpu_has_dc_aliases define for XLP Jayachandran C
2012-07-13 16:23 ` [PATCH 05/12] MIPS: PCI: Fix for byte swap for Netlogic XLP Jayachandran C
2012-07-24 14:58   ` Ralf Baechle
2012-07-13 16:23 ` [PATCH 06/12] MIPS: Netlogic: early console fix Jayachandran C
2012-07-13 16:27   ` Florian Fainelli
2012-07-16 10:03     ` [PATCH UPDATED " Jayachandran C
2012-07-13 16:23 ` [PATCH 07/12] MIPS: Netlogic: DTS file for XLP boards Jayachandran C
2012-07-13 16:23 ` [PATCH 08/12] MIPS: Netlogic: Move serial ports to device tree Jayachandran C
2012-07-13 16:23 ` Jayachandran C [this message]
2012-07-13 16:23 ` [PATCH 10/12] MIPS: oprofile: Support for XLR/XLS processors Jayachandran C
2012-07-13 16:23 ` [PATCH 11/12] MIPS: perf: Add XLP support for hardware perf Jayachandran C
2012-07-13 16:23 ` [PATCH 12/12] MIPS: Netlogic: XLP defconfig update Jayachandran C
2012-08-21 12:52   ` Ralf Baechle
2012-08-22 12:57     ` Jayachandran C.

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=1342196605-4260-10-git-send-email-jayachandranc@netlogicmicro.com \
    --to=jayachandranc@netlogicmicro.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@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.