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

ARM: msm: Add devicetree support for msm8660-surf

Adds support for booting via device tree with a simple serial console.

Change-Id: I7f175b8db21928cd13e0fb49f3eed74966a2696f
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>

+75 -7
+24
arch/arm/boot/dts/msm8660-surf.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "skeleton.dtsi" 4 + 5 + / { 6 + model = "Qualcomm MSM8660 SURF"; 7 + compatible = "qcom,msm8660-surf", "qcom,msm8660"; 8 + interrupt-parent = <&intc>; 9 + 10 + intc: interrupt-controller@02080000 { 11 + compatible = "qcom,msm-8660-qgic"; 12 + interrupt-controller; 13 + #interrupt-cells = <1>; 14 + reg = < 0x02080000 0x1000 >, 15 + < 0x02081000 0x1000 >; 16 + }; 17 + 18 + serial@19c400000 { 19 + compatible = "qcom,msm-hsuart", "qcom,msm-uart"; 20 + reg = <0x19c40000 0x1000>, 21 + <0x19c00000 0x1000>; 22 + interrupts = <195>; 23 + }; 24 + };
+51 -7
arch/arm/mach-msm/board-msm8x60.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010, 2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 8 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 10 * GNU General Public License for more details. 11 - * 12 - * You should have received a copy of the GNU General Public License 13 - * along with this program; if not, write to the Free Software 14 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 - * 02110-1301, USA. 16 - * 17 11 */ 18 12 19 13 #include <linux/kernel.h> 20 14 #include <linux/platform_device.h> 21 15 #include <linux/io.h> 22 16 #include <linux/irq.h> 17 + #include <linux/irqdomain.h> 18 + #include <linux/of.h> 19 + #include <linux/of_address.h> 20 + #include <linux/of_platform.h> 23 21 24 22 #include <asm/mach-types.h> 25 23 #include <asm/mach/arch.h> ··· 62 64 { 63 65 } 64 66 67 + #ifdef CONFIG_OF 68 + static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = { 69 + {} 70 + }; 71 + 72 + static struct of_device_id msm_dt_gic_match[] __initdata = { 73 + { .compatible = "qcom,msm-8660-qgic", }, 74 + {} 75 + }; 76 + 77 + static void __init msm8x60_dt_init(void) 78 + { 79 + struct device_node *node; 80 + 81 + node = of_find_matching_node_by_address(NULL, msm_dt_gic_match, 82 + MSM8X60_QGIC_DIST_PHYS); 83 + if (node) 84 + irq_domain_add_simple(node, GIC_SPI_START); 85 + 86 + if (of_machine_is_compatible("qcom,msm8660-surf")) { 87 + printk(KERN_INFO "Init surf UART registers\n"); 88 + msm8x60_init_uart12dm(); 89 + } 90 + 91 + of_platform_populate(NULL, of_default_bus_match_table, 92 + msm_auxdata_lookup, NULL); 93 + } 94 + 95 + static const char *msm8x60_fluid_match[] __initdata = { 96 + "qcom,msm8660-fluid", 97 + "qcom,msm8660-surf", 98 + NULL 99 + }; 100 + #endif /* CONFIG_OF */ 101 + 65 102 MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3") 66 103 .map_io = msm8x60_map_io, 67 104 .init_irq = msm8x60_init_irq, ··· 124 91 .init_machine = msm8x60_init, 125 92 .timer = &msm_timer, 126 93 MACHINE_END 94 + 95 + #ifdef CONFIG_OF 96 + /* TODO: General device tree support for all MSM. */ 97 + DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") 98 + .map_io = msm8x60_map_io, 99 + .init_irq = msm8x60_init_irq, 100 + .init_machine = msm8x60_dt_init, 101 + .timer = &msm_timer, 102 + .dt_compat = msm8x60_fluid_match, 103 + MACHINE_END 104 + #endif /* CONFIG_OF */