aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2015-05-22 11:51:02 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 15:54:29 -0400
commite8823d26b4f18faeecf8f46adaecc52a7154c41f (patch)
treebd371a764309fb9b197fb52e81f425f3cdae09cf
parent56d4c99b848ce3a07cf3643e1f2dc78419f0f954 (diff)
MIPS: Malta: Basic DT plumbing
Build a DT for the Malta platform into the kernel, load it & probe devices from it. The DT is essentially empty at this point, devices will be added in further patches. [ralf@linux-mips.org: Fixed conflicts.] Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: Andrew Bresticker <abrestic@chromium.org> Cc: linux-kernel@vger.kernel.org Cc: Markos Chandras <markos.chandras@imgtec.com> Patchwork: http://patchwork.linux-mips.org/patch/10119/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/Kconfig2
-rw-r--r--arch/mips/boot/dts/mti/Makefile1
-rw-r--r--arch/mips/boot/dts/mti/malta.dts7
-rw-r--r--arch/mips/mti-malta/Makefile2
-rw-r--r--arch/mips/mti-malta/malta-dt.c34
-rw-r--r--arch/mips/mti-malta/malta-setup.c4
6 files changed, 49 insertions, 1 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 5e8ba716e441..d53b43237f7f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -404,6 +404,7 @@ config MIPS_MALTA
404 select ARCH_MAY_HAVE_PC_FDC 404 select ARCH_MAY_HAVE_PC_FDC
405 select BOOT_ELF32 405 select BOOT_ELF32
406 select BOOT_RAW 406 select BOOT_RAW
407 select BUILTIN_DTB
407 select CEVT_R4K 408 select CEVT_R4K
408 select CSRC_R4K 409 select CSRC_R4K
409 select CLKSRC_MIPS_GIC 410 select CLKSRC_MIPS_GIC
@@ -443,6 +444,7 @@ config MIPS_MALTA
443 select SYS_SUPPORTS_MULTITHREADING 444 select SYS_SUPPORTS_MULTITHREADING
444 select SYS_SUPPORTS_SMARTMIPS 445 select SYS_SUPPORTS_SMARTMIPS
445 select SYS_SUPPORTS_ZBOOT 446 select SYS_SUPPORTS_ZBOOT
447 select USE_OF
446 select ZONE_DMA32 if 64BIT 448 select ZONE_DMA32 if 64BIT
447 help 449 help
448 This enables support for the MIPS Technologies Malta evaluation 450 This enables support for the MIPS Technologies Malta evaluation
diff --git a/arch/mips/boot/dts/mti/Makefile b/arch/mips/boot/dts/mti/Makefile
index ef1f3dbed033..144d776cc9f2 100644
--- a/arch/mips/boot/dts/mti/Makefile
+++ b/arch/mips/boot/dts/mti/Makefile
@@ -1,3 +1,4 @@
1dtb-$(CONFIG_MIPS_MALTA) += malta.dtb
1dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb 2dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb
2 3
3obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
diff --git a/arch/mips/boot/dts/mti/malta.dts b/arch/mips/boot/dts/mti/malta.dts
new file mode 100644
index 000000000000..c678115f5b7f
--- /dev/null
+++ b/arch/mips/boot/dts/mti/malta.dts
@@ -0,0 +1,7 @@
1/dts-v1/;
2
3/ {
4 #address-cells = <1>;
5 #size-cells = <1>;
6 compatible = "mti,malta";
7};
diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile
index 6510ace272d4..ea35587a5c29 100644
--- a/arch/mips/mti-malta/Makefile
+++ b/arch/mips/mti-malta/Makefile
@@ -5,7 +5,7 @@
5# Copyright (C) 2008 Wind River Systems, Inc. 5# Copyright (C) 2008 Wind River Systems, Inc.
6# written by Ralf Baechle <ralf@linux-mips.org> 6# written by Ralf Baechle <ralf@linux-mips.org>
7# 7#
8obj-y := malta-display.o malta-init.o \ 8obj-y := malta-display.o malta-dt.o malta-init.o \
9 malta-int.o malta-memory.o malta-platform.o \ 9 malta-int.o malta-memory.o malta-platform.o \
10 malta-reset.o malta-setup.o malta-time.o 10 malta-reset.o malta-setup.o malta-time.o
11 11
diff --git a/arch/mips/mti-malta/malta-dt.c b/arch/mips/mti-malta/malta-dt.c
new file mode 100644
index 000000000000..47a22889285f
--- /dev/null
+++ b/arch/mips/mti-malta/malta-dt.c
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2015 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/clk-provider.h>
12#include <linux/init.h>
13#include <linux/of_fdt.h>
14#include <linux/of_platform.h>
15
16void __init device_tree_init(void)
17{
18 unflatten_and_copy_device_tree();
19}
20
21static const struct of_device_id bus_ids[] __initconst = {
22 { .compatible = "simple-bus", },
23 { .compatible = "isa", },
24 {},
25};
26
27static int __init publish_devices(void)
28{
29 if (!of_have_populated_dt())
30 return 0;
31
32 return of_platform_bus_probe(NULL, bus_ids, NULL);
33}
34device_initcall(publish_devices);
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
index db7c9e5826a6..9d1e7f5ec36c 100644
--- a/arch/mips/mti-malta/malta-setup.c
+++ b/arch/mips/mti-malta/malta-setup.c
@@ -21,6 +21,7 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/of_fdt.h>
24#include <linux/pci.h> 25#include <linux/pci.h>
25#include <linux/screen_info.h> 26#include <linux/screen_info.h>
26#include <linux/time.h> 27#include <linux/time.h>
@@ -31,6 +32,7 @@
31#include <asm/mips-boards/malta.h> 32#include <asm/mips-boards/malta.h>
32#include <asm/mips-boards/maltaint.h> 33#include <asm/mips-boards/maltaint.h>
33#include <asm/dma.h> 34#include <asm/dma.h>
35#include <asm/prom.h>
34#include <asm/traps.h> 36#include <asm/traps.h>
35#ifdef CONFIG_VT 37#ifdef CONFIG_VT
36#include <linux/console.h> 38#include <linux/console.h>
@@ -249,6 +251,8 @@ void __init plat_mem_setup(void)
249{ 251{
250 unsigned int i; 252 unsigned int i;
251 253
254 __dt_setup_arch(__dtb_start);
255
252 if (config_enabled(CONFIG_EVA)) 256 if (config_enabled(CONFIG_EVA))
253 /* EVA has already been configured in mach-malta/kernel-init.h */ 257 /* EVA has already been configured in mach-malta/kernel-init.h */
254 pr_info("Enhanced Virtual Addressing (EVA) activated\n"); 258 pr_info("Enhanced Virtual Addressing (EVA) activated\n");