summaryrefslogtreecommitdiff
path: root/arch/mips/netlogic/xlp
diff options
context:
space:
mode:
authorJayachandran C <jayachandranc@netlogicmicro.com>2012-07-13 16:23:22 (GMT)
committerJohn Crispin <blogic@openwrt.org>2012-08-22 21:46:37 (GMT)
commit2f6528e15a4592c762a690c1320518368593ae75 (patch)
tree6fd1aafd2586875f2905398a1e0ab8f5c571142a /arch/mips/netlogic/xlp
parenta9f16821205d7561bf9d622855e1aa95e5c77f0c (diff)
downloadlinux-fsl-qoriq-2f6528e15a4592c762a690c1320518368593ae75.tar.xz
MIPS: Netlogic: Add support for built in DTB
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> Patchwork: http://patchwork.linux-mips.org/patch/4103/ Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/netlogic/xlp')
-rw-r--r--arch/mips/netlogic/xlp/setup.c12
1 files changed, 11 insertions, 1 deletions
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));