Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Paul Burton and committed by
Ralf Baechle
e8823d26 56d4c99b

+49 -1
+2
arch/mips/Kconfig
··· 404 404 select ARCH_MAY_HAVE_PC_FDC 405 405 select BOOT_ELF32 406 406 select BOOT_RAW 407 + select BUILTIN_DTB 407 408 select CEVT_R4K 408 409 select CSRC_R4K 409 410 select CLKSRC_MIPS_GIC ··· 444 443 select SYS_SUPPORTS_MULTITHREADING 445 444 select SYS_SUPPORTS_SMARTMIPS 446 445 select SYS_SUPPORTS_ZBOOT 446 + select USE_OF 447 447 select ZONE_DMA32 if 64BIT 448 448 help 449 449 This enables support for the MIPS Technologies Malta evaluation
+1
arch/mips/boot/dts/mti/Makefile
··· 1 + dtb-$(CONFIG_MIPS_MALTA) += malta.dtb 1 2 dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb 2 3 3 4 obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+7
arch/mips/boot/dts/mti/malta.dts
··· 1 + /dts-v1/; 2 + 3 + / { 4 + #address-cells = <1>; 5 + #size-cells = <1>; 6 + compatible = "mti,malta"; 7 + };
+1 -1
arch/mips/mti-malta/Makefile
··· 5 5 # Copyright (C) 2008 Wind River Systems, Inc. 6 6 # written by Ralf Baechle <ralf@linux-mips.org> 7 7 # 8 - obj-y := malta-display.o malta-init.o \ 8 + obj-y := malta-display.o malta-dt.o malta-init.o \ 9 9 malta-int.o malta-memory.o malta-platform.o \ 10 10 malta-reset.o malta-setup.o malta-time.o 11 11
+34
arch/mips/mti-malta/malta-dt.c
··· 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 + 16 + void __init device_tree_init(void) 17 + { 18 + unflatten_and_copy_device_tree(); 19 + } 20 + 21 + static const struct of_device_id bus_ids[] __initconst = { 22 + { .compatible = "simple-bus", }, 23 + { .compatible = "isa", }, 24 + {}, 25 + }; 26 + 27 + static 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 + } 34 + device_initcall(publish_devices);
+4
arch/mips/mti-malta/malta-setup.c
··· 21 21 #include <linux/sched.h> 22 22 #include <linux/ioport.h> 23 23 #include <linux/irq.h> 24 + #include <linux/of_fdt.h> 24 25 #include <linux/pci.h> 25 26 #include <linux/screen_info.h> 26 27 #include <linux/time.h> ··· 32 31 #include <asm/mips-boards/malta.h> 33 32 #include <asm/mips-boards/maltaint.h> 34 33 #include <asm/dma.h> 34 + #include <asm/prom.h> 35 35 #include <asm/traps.h> 36 36 #ifdef CONFIG_VT 37 37 #include <linux/console.h> ··· 250 248 void __init plat_mem_setup(void) 251 249 { 252 250 unsigned int i; 251 + 252 + __dt_setup_arch(__dtb_start); 253 253 254 254 if (config_enabled(CONFIG_EVA)) 255 255 /* EVA has already been configured in mach-malta/kernel-init.h */