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

ARM i.MX35: Add devicetree support.

Cc: linux-arm-kernel@lists.infradead.org
Cc: Eric Bénard <eric@eukrea.com>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Denis Carikli <denis@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

authored by

Steffen Trumtrar and committed by
Shawn Guo
a55a3d72 920c9648

+186
+113
Documentation/devicetree/bindings/clock/imx35-clock.txt
··· 1 + * Clock bindings for Freescale i.MX35 2 + 3 + Required properties: 4 + - compatible: Should be "fsl,imx35-ccm" 5 + - reg: Address and length of the register set 6 + - interrupts: Should contain CCM interrupt 7 + - #clock-cells: Should be <1> 8 + 9 + The clock consumer should specify the desired clock by having the clock 10 + ID in its "clocks" phandle cell. The following is a full list of i.MX35 11 + clocks and IDs. 12 + 13 + Clock ID 14 + --------------------------- 15 + ckih 0 16 + mpll 1 17 + ppll 2 18 + mpll_075 3 19 + arm 4 20 + hsp 5 21 + hsp_div 6 22 + hsp_sel 7 23 + ahb 8 24 + ipg 9 25 + arm_per_div 10 26 + ahb_per_div 11 27 + ipg_per 12 28 + uart_sel 13 29 + uart_div 14 30 + esdhc_sel 15 31 + esdhc1_div 16 32 + esdhc2_div 17 33 + esdhc3_div 18 34 + spdif_sel 19 35 + spdif_div_pre 20 36 + spdif_div_post 21 37 + ssi_sel 22 38 + ssi1_div_pre 23 39 + ssi1_div_post 24 40 + ssi2_div_pre 25 41 + ssi2_div_post 26 42 + usb_sel 27 43 + usb_div 28 44 + nfc_div 29 45 + asrc_gate 30 46 + pata_gate 31 47 + audmux_gate 32 48 + can1_gate 33 49 + can2_gate 34 50 + cspi1_gate 35 51 + cspi2_gate 36 52 + ect_gate 37 53 + edio_gate 38 54 + emi_gate 39 55 + epit1_gate 40 56 + epit2_gate 41 57 + esai_gate 42 58 + esdhc1_gate 43 59 + esdhc2_gate 44 60 + esdhc3_gate 45 61 + fec_gate 46 62 + gpio1_gate 47 63 + gpio2_gate 48 64 + gpio3_gate 49 65 + gpt_gate 50 66 + i2c1_gate 51 67 + i2c2_gate 52 68 + i2c3_gate 53 69 + iomuxc_gate 54 70 + ipu_gate 55 71 + kpp_gate 56 72 + mlb_gate 57 73 + mshc_gate 58 74 + owire_gate 59 75 + pwm_gate 60 76 + rngc_gate 61 77 + rtc_gate 62 78 + rtic_gate 63 79 + scc_gate 64 80 + sdma_gate 65 81 + spba_gate 66 82 + spdif_gate 67 83 + ssi1_gate 68 84 + ssi2_gate 69 85 + uart1_gate 70 86 + uart2_gate 71 87 + uart3_gate 72 88 + usbotg_gate 73 89 + wdog_gate 74 90 + max_gate 75 91 + admux_gate 76 92 + csi_gate 77 93 + csi_div 78 94 + csi_sel 79 95 + iim_gate 80 96 + gpu2d_gate 81 97 + 98 + Examples: 99 + 100 + clks: ccm@53f80000 { 101 + compatible = "fsl,imx35-ccm"; 102 + reg = <0x53f80000 0x4000>; 103 + interrupts = <31>; 104 + #clock-cells = <1>; 105 + }; 106 + 107 + esdhc1: esdhc@53fb4000 { 108 + compatible = "fsl,imx35-esdhc"; 109 + reg = <0x53fb4000 0x4000>; 110 + interrupts = <7>; 111 + clocks = <&clks 9>, <&clks 8>, <&clks 43>; 112 + clock-names = "ipg", "ahb", "per"; 113 + };
+8
arch/arm/mach-imx/Kconfig
··· 126 126 select HAVE_EPIT 127 127 select MXC_AVIC 128 128 select SMP_ON_UP if SMP 129 + select PINCTRL 129 130 130 131 config SOC_IMX5 131 132 bool ··· 611 610 using the device tree for discovery. 612 611 613 612 comment "MX35 platforms:" 613 + 614 + config MACH_IMX35_DT 615 + bool "Support i.MX35 platforms from device tree" 616 + select SOC_IMX35 617 + help 618 + Include support for Freescale i.MX35 based platforms 619 + using the device tree for discovery. 614 620 615 621 config MACH_PCM043 616 622 bool "Support Phytec pcm043 (i.MX35) platforms"
+1
arch/arm/mach-imx/Makefile
··· 89 89 obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o 90 90 obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o 91 91 obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o 92 + obj-$(CONFIG_MACH_IMX35_DT) += imx35-dt.o 92 93 93 94 obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o 94 95 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
+14
arch/arm/mach-imx/clk-imx35.c
··· 45 45 static char hsp_div_532[] = { 4, 8, 3, 0 }; 46 46 static char hsp_div_400[] = { 3, 6, 3, 0 }; 47 47 48 + static struct clk_onecell_data clk_data; 49 + 48 50 static const char *std_sel[] = {"ppll", "arm"}; 49 51 static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"}; 50 52 ··· 288 286 289 287 return 0; 290 288 } 289 + 290 + static int __init mx35_clocks_init_dt(struct device_node *ccm_node) 291 + { 292 + clk_data.clks = clk; 293 + clk_data.clk_num = ARRAY_SIZE(clk); 294 + of_clk_add_provider(ccm_node, of_clk_src_onecell_get, &clk_data); 295 + 296 + mx35_clocks_init(); 297 + 298 + return 0; 299 + } 300 + CLK_OF_DECLARE(imx35, "fsl,imx35-ccm", mx35_clocks_init_dt);
+50
arch/arm/mach-imx/imx35-dt.c
··· 1 + /* 2 + * Copyright 2012 Steffen Trumtrar, Pengutronix 3 + * 4 + * based on imx27-dt.c 5 + * 6 + * This program is free software; you can redistribute it and/or modify it under 7 + * the terms of the GNU General Public License version 2 as published by the 8 + * Free Software Foundation. 9 + */ 10 + 11 + #include <linux/irq.h> 12 + #include <linux/irqdomain.h> 13 + #include <linux/of_irq.h> 14 + #include <linux/of_platform.h> 15 + #include <linux/clk-provider.h> 16 + #include <linux/clocksource.h> 17 + #include <asm/mach/arch.h> 18 + #include <asm/mach/time.h> 19 + #include <asm/hardware/cache-l2x0.h> 20 + #include "common.h" 21 + #include "mx35.h" 22 + 23 + static void __init imx35_dt_init(void) 24 + { 25 + mxc_arch_reset_init_dt(); 26 + 27 + of_platform_populate(NULL, of_default_bus_match_table, 28 + NULL, NULL); 29 + } 30 + 31 + static void __init imx35_irq_init(void) 32 + { 33 + imx_init_l2cache(); 34 + mx35_init_irq(); 35 + } 36 + 37 + static const char *imx35_dt_board_compat[] __initconst = { 38 + "fsl,imx35", 39 + NULL 40 + }; 41 + 42 + DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)") 43 + .map_io = mx35_map_io, 44 + .init_early = imx35_init_early, 45 + .init_irq = imx35_irq_init, 46 + .handle_irq = imx35_handle_irq, 47 + .init_machine = imx35_dt_init, 48 + .dt_compat = imx35_dt_board_compat, 49 + .restart = mxc_restart, 50 + MACHINE_END