diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-13 13:39:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-13 13:39:26 -0500 |
commit | db5b0ae00712b5176d7405e7a1dd2bfd6e8f5070 (patch) | |
tree | 4e874d81ca9037dda1007178bbc9613649d43305 /arch/arm/mach-imx | |
parent | 6be35c700f742e911ecedd07fcc43d4439922334 (diff) | |
parent | 64507dd7028e3e0145077e73b8374bd75aea117c (diff) |
Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree conversions and enablement from Olof Johansson:
"Continued device tree conversion and enablement across a number of
platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other
smaller series as well.
ux500 has seen continued conversion for platforms. Several platforms
have seen pinctrl-via-devicetree conversions for simpler
multiplatform. Tegra is adding data for new devices/drivers, and
Exynos has a bunch of new bindings and devices added as well.
So, pretty much the same progression in the right direction as the
last few releases."
Fix up conflicts as per Olof.
* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (185 commits)
ARM: ux500: Rename dbx500 cpufreq code to be more generic
ARM: dts: add missing ux500 device trees
ARM: ux500: Stop registering the PCM driver from platform code
ARM: ux500: Move board specific GPIO info out to subordinate DTS files
ARM: ux500: Disable the MMCI gpio-regulator by default
ARM: Kirkwood: remove kirkwood_ehci_init() from new boards
ARM: Kirkwood: Add support LED of OpenBlocks A6
ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6
ARM: kirkwood: Add NAND partiton map for OpenBlocks A6
ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6
ARM: kirkwood: Add support DT of second I2C bus
ARM: kirkwood: Convert mplcec4 board to pinctrl
ARM: Kirkwood: Convert km_kirkwood to pinctrl
ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl
ARM: Kirkwood: Convert IX2-200 to pinctrl.
ARM: Kirkwood: Convert lsxl boards to pinctrl.
ARM: Kirkwood: Convert ib62x0 to pinctrl.
ARM: Kirkwood: Convert GoFlex Net to pinctrl.
ARM: Kirkwood: Convert dreamplug to pinctrl.
ARM: Kirkwood: Convert dockstar to pinctrl.
...
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 18 | ||||
-rw-r--r-- | arch/arm/mach-imx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx25.c | 119 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx6q.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx25-dt.c | 48 | ||||
-rw-r--r-- | arch/arm/mach-imx/lluart.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 35 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx6q.h | 4 |
9 files changed, 229 insertions, 26 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 4e24b8c77eb4..1ad0d76de8c7 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -272,6 +272,13 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD | |||
272 | 272 | ||
273 | endchoice | 273 | endchoice |
274 | 274 | ||
275 | config MACH_IMX25_DT | ||
276 | bool "Support i.MX25 platforms from device tree" | ||
277 | select SOC_IMX25 | ||
278 | help | ||
279 | Include support for Freescale i.MX25 based platforms | ||
280 | using the device tree for discovery | ||
281 | |||
275 | comment "MX27 platforms:" | 282 | comment "MX27 platforms:" |
276 | 283 | ||
277 | config MACH_MX27ADS | 284 | config MACH_MX27ADS |
@@ -831,7 +838,14 @@ config SOC_IMX53 | |||
831 | 838 | ||
832 | config SOC_IMX6Q | 839 | config SOC_IMX6Q |
833 | bool "i.MX6 Quad support" | 840 | bool "i.MX6 Quad support" |
841 | select ARCH_HAS_CPUFREQ | ||
842 | select ARCH_HAS_OPP | ||
834 | select ARM_CPU_SUSPEND if PM | 843 | select ARM_CPU_SUSPEND if PM |
844 | select ARM_ERRATA_743622 | ||
845 | select ARM_ERRATA_751472 | ||
846 | select ARM_ERRATA_754322 | ||
847 | select ARM_ERRATA_764369 if SMP | ||
848 | select ARM_ERRATA_775420 | ||
835 | select ARM_GIC | 849 | select ARM_GIC |
836 | select COMMON_CLK | 850 | select COMMON_CLK |
837 | select CPU_V7 | 851 | select CPU_V7 |
@@ -843,6 +857,10 @@ config SOC_IMX6Q | |||
843 | select MFD_SYSCON | 857 | select MFD_SYSCON |
844 | select PINCTRL | 858 | select PINCTRL |
845 | select PINCTRL_IMX6Q | 859 | select PINCTRL_IMX6Q |
860 | select PL310_ERRATA_588369 if CACHE_PL310 | ||
861 | select PL310_ERRATA_727915 if CACHE_PL310 | ||
862 | select PL310_ERRATA_769419 if CACHE_PL310 | ||
863 | select PM_OPP if PM | ||
846 | 864 | ||
847 | help | 865 | help |
848 | This enables support for Freescale i.MX6 Quad processor. | 866 | This enables support for Freescale i.MX6 Quad processor. |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index fe47b71469c9..0634b3152c24 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -50,6 +50,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o | |||
50 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o | 50 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o |
51 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o | 51 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o |
52 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o | 52 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o |
53 | obj-$(CONFIG_MACH_IMX25_DT) += imx25-dt.o | ||
53 | 54 | ||
54 | # i.MX27 based machines | 55 | # i.MX27 based machines |
55 | obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o | 56 | obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index bc885801cd68..b197aa73dc4b 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/of.h> | ||
27 | #include <linux/of_address.h> | ||
28 | #include <linux/of_irq.h> | ||
26 | 29 | ||
27 | #include "clk.h" | 30 | #include "clk.h" |
28 | #include "common.h" | 31 | #include "common.h" |
@@ -55,6 +58,8 @@ | |||
55 | 58 | ||
56 | #define ccm(x) (CRM_BASE + (x)) | 59 | #define ccm(x) (CRM_BASE + (x)) |
57 | 60 | ||
61 | static struct clk_onecell_data clk_data; | ||
62 | |||
58 | static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", }; | 63 | static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", }; |
59 | static const char *per_sel_clks[] = { "ahb", "upll", }; | 64 | static const char *per_sel_clks[] = { "ahb", "upll", }; |
60 | 65 | ||
@@ -64,24 +69,30 @@ enum mx25_clks { | |||
64 | per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel, | 69 | per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel, |
65 | per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5, | 70 | per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5, |
66 | per6, per7, per8, per9, per10, per11, per12, per13, per14, per15, | 71 | per6, per7, per8, per9, per10, per11, per12, per13, per14, per15, |
67 | csi_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per, gpt_ipg_per, i2c_ipg_per, | 72 | csi_ipg_per, epit_ipg_per, esai_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per, |
68 | lcdc_ipg_per, nfc_ipg_per, ssi1_ipg_per, ssi2_ipg_per, uart_ipg_per, | 73 | gpt_ipg_per, i2c_ipg_per, lcdc_ipg_per, nfc_ipg_per, owire_ipg_per, |
69 | csi_ahb, esdhc1_ahb, esdhc2_ahb, fec_ahb, lcdc_ahb, sdma_ahb, | 74 | pwm_ipg_per, sim1_ipg_per, sim2_ipg_per, ssi1_ipg_per, ssi2_ipg_per, |
70 | usbotg_ahb, can1_ipg, can2_ipg, csi_ipg, cspi1_ipg, cspi2_ipg, | 75 | uart_ipg_per, ata_ahb, reserved1, csi_ahb, emi_ahb, esai_ahb, esdhc1_ahb, |
71 | cspi3_ipg, dryice_ipg, esdhc1_ipg, esdhc2_ipg, fec_ipg, iim_ipg, | 76 | esdhc2_ahb, fec_ahb, lcdc_ahb, rtic_ahb, sdma_ahb, slcdc_ahb, usbotg_ahb, |
72 | kpp_ipg, lcdc_ipg, pwm1_ipg, pwm2_ipg, pwm3_ipg, pwm4_ipg, sdma_ipg, | 77 | reserved2, reserved3, reserved4, reserved5, can1_ipg, can2_ipg, csi_ipg, |
73 | ssi1_ipg, ssi2_ipg, tsc_ipg, uart1_ipg, uart2_ipg, uart3_ipg, | 78 | cspi1_ipg, cspi2_ipg, cspi3_ipg, dryice_ipg, ect_ipg, epit1_ipg, epit2_ipg, |
74 | uart4_ipg, uart5_ipg, wdt_ipg, clk_max | 79 | reserved6, esdhc1_ipg, esdhc2_ipg, fec_ipg, reserved7, reserved8, reserved9, |
80 | gpt1_ipg, gpt2_ipg, gpt3_ipg, gpt4_ipg, reserved10, reserved11, reserved12, | ||
81 | iim_ipg, reserved13, reserved14, kpp_ipg, lcdc_ipg, reserved15, pwm1_ipg, | ||
82 | pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg, | ||
83 | sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg, | ||
84 | uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17, | ||
85 | wdt_ipg, clk_max | ||
75 | }; | 86 | }; |
76 | 87 | ||
77 | static struct clk *clk[clk_max]; | 88 | static struct clk *clk[clk_max]; |
78 | 89 | ||
79 | int __init mx25_clocks_init(void) | 90 | static int __init __mx25_clocks_init(unsigned long osc_rate) |
80 | { | 91 | { |
81 | int i; | 92 | int i; |
82 | 93 | ||
83 | clk[dummy] = imx_clk_fixed("dummy", 0); | 94 | clk[dummy] = imx_clk_fixed("dummy", 0); |
84 | clk[osc] = imx_clk_fixed("osc", 24000000); | 95 | clk[osc] = imx_clk_fixed("osc", osc_rate); |
85 | clk[mpll] = imx_clk_pllv1("mpll", "osc", ccm(CCM_MPCTL)); | 96 | clk[mpll] = imx_clk_pllv1("mpll", "osc", ccm(CCM_MPCTL)); |
86 | clk[upll] = imx_clk_pllv1("upll", "osc", ccm(CCM_UPCTL)); | 97 | clk[upll] = imx_clk_pllv1("upll", "osc", ccm(CCM_UPCTL)); |
87 | clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4); | 98 | clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4); |
@@ -123,22 +134,36 @@ int __init mx25_clocks_init(void) | |||
123 | clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6); | 134 | clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6); |
124 | clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6); | 135 | clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6); |
125 | clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0); | 136 | clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0); |
137 | clk[epit_ipg_per] = imx_clk_gate("epit_ipg_per", "per1", ccm(CCM_CGCR0), 1); | ||
138 | clk[esai_ipg_per] = imx_clk_gate("esai_ipg_per", "per2", ccm(CCM_CGCR0), 2); | ||
126 | clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0), 3); | 139 | clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0), 3); |
127 | clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4); | 140 | clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4); |
128 | clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5); | 141 | clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5); |
129 | clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6); | 142 | clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6); |
130 | clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7); | 143 | clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7); |
131 | clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8); | 144 | clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8); |
145 | clk[owire_ipg_per] = imx_clk_gate("owire_ipg_per", "per9", ccm(CCM_CGCR0), 9); | ||
146 | clk[pwm_ipg_per] = imx_clk_gate("pwm_ipg_per", "per10", ccm(CCM_CGCR0), 10); | ||
147 | clk[sim1_ipg_per] = imx_clk_gate("sim1_ipg_per", "per11", ccm(CCM_CGCR0), 11); | ||
148 | clk[sim2_ipg_per] = imx_clk_gate("sim2_ipg_per", "per12", ccm(CCM_CGCR0), 12); | ||
132 | clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13); | 149 | clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13); |
133 | clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14); | 150 | clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14); |
134 | clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15); | 151 | clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15); |
152 | clk[ata_ahb] = imx_clk_gate("ata_ahb", "ahb", ccm(CCM_CGCR0), 16); | ||
153 | /* CCM_CGCR0(17): reserved */ | ||
135 | clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18); | 154 | clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18); |
155 | clk[emi_ahb] = imx_clk_gate("emi_ahb", "ahb", ccm(CCM_CGCR0), 19); | ||
156 | clk[esai_ahb] = imx_clk_gate("esai_ahb", "ahb", ccm(CCM_CGCR0), 20); | ||
136 | clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21); | 157 | clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21); |
137 | clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22); | 158 | clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22); |
138 | clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23); | 159 | clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23); |
139 | clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24); | 160 | clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24); |
161 | clk[rtic_ahb] = imx_clk_gate("rtic_ahb", "ahb", ccm(CCM_CGCR0), 25); | ||
140 | clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26); | 162 | clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26); |
163 | clk[slcdc_ahb] = imx_clk_gate("slcdc_ahb", "ahb", ccm(CCM_CGCR0), 27); | ||
141 | clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28); | 164 | clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28); |
165 | /* CCM_CGCR0(29-31): reserved */ | ||
166 | /* CCM_CGCR1(0): reserved in datasheet, used as audmux in FSL kernel */ | ||
142 | clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1), 2); | 167 | clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1), 2); |
143 | clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1), 3); | 168 | clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1), 3); |
144 | clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1), 4); | 169 | clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1), 4); |
@@ -146,17 +171,41 @@ int __init mx25_clocks_init(void) | |||
146 | clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1), 6); | 171 | clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1), 6); |
147 | clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1), 7); | 172 | clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1), 7); |
148 | clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1), 8); | 173 | clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1), 8); |
174 | clk[ect_ipg] = imx_clk_gate("ect_ipg", "ipg", ccm(CCM_CGCR1), 9); | ||
175 | clk[epit1_ipg] = imx_clk_gate("epit1_ipg", "ipg", ccm(CCM_CGCR1), 10); | ||
176 | clk[epit2_ipg] = imx_clk_gate("epit2_ipg", "ipg", ccm(CCM_CGCR1), 11); | ||
177 | /* CCM_CGCR1(12): reserved in datasheet, used as esai in FSL kernel */ | ||
149 | clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13); | 178 | clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13); |
150 | clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14); | 179 | clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14); |
151 | clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15); | 180 | clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15); |
181 | /* CCM_CGCR1(16): reserved in datasheet, used as gpio1 in FSL kernel */ | ||
182 | /* CCM_CGCR1(17): reserved in datasheet, used as gpio2 in FSL kernel */ | ||
183 | /* CCM_CGCR1(18): reserved in datasheet, used as gpio3 in FSL kernel */ | ||
184 | clk[gpt1_ipg] = imx_clk_gate("gpt1_ipg", "ipg", ccm(CCM_CGCR1), 19); | ||
185 | clk[gpt2_ipg] = imx_clk_gate("gpt2_ipg", "ipg", ccm(CCM_CGCR1), 20); | ||
186 | clk[gpt3_ipg] = imx_clk_gate("gpt3_ipg", "ipg", ccm(CCM_CGCR1), 21); | ||
187 | clk[gpt4_ipg] = imx_clk_gate("gpt4_ipg", "ipg", ccm(CCM_CGCR1), 22); | ||
188 | /* CCM_CGCR1(23): reserved in datasheet, used as i2c1 in FSL kernel */ | ||
189 | /* CCM_CGCR1(24): reserved in datasheet, used as i2c2 in FSL kernel */ | ||
190 | /* CCM_CGCR1(25): reserved in datasheet, used as i2c3 in FSL kernel */ | ||
152 | clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26); | 191 | clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26); |
192 | /* CCM_CGCR1(27): reserved in datasheet, used as iomuxc in FSL kernel */ | ||
193 | /* CCM_CGCR1(28): reserved in datasheet, used as kpp in FSL kernel */ | ||
153 | clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28); | 194 | clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28); |
154 | clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29); | 195 | clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29); |
196 | /* CCM_CGCR1(30): reserved in datasheet, used as owire in FSL kernel */ | ||
155 | clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31); | 197 | clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31); |
156 | clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2), 0); | 198 | clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2), 0); |
157 | clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2), 1); | 199 | clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2), 1); |
158 | clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2), 2); | 200 | clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2), 2); |
201 | clk[rngb_ipg] = imx_clk_gate("rngb_ipg", "ipg", ccm(CCM_CGCR2), 3); | ||
202 | /* CCM_CGCR2(4): reserved in datasheet, used as rtic in FSL kernel */ | ||
203 | clk[scc_ipg] = imx_clk_gate("scc_ipg", "ipg", ccm(CCM_CGCR2), 5); | ||
159 | clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2), 6); | 204 | clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2), 6); |
205 | clk[sim1_ipg] = imx_clk_gate("sim1_ipg", "ipg", ccm(CCM_CGCR2), 7); | ||
206 | clk[sim2_ipg] = imx_clk_gate("sim2_ipg", "ipg", ccm(CCM_CGCR2), 8); | ||
207 | clk[slcdc_ipg] = imx_clk_gate("slcdc_ipg", "ipg", ccm(CCM_CGCR2), 9); | ||
208 | clk[spba_ipg] = imx_clk_gate("spba_ipg", "ipg", ccm(CCM_CGCR2), 10); | ||
160 | clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11); | 209 | clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11); |
161 | clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12); | 210 | clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12); |
162 | clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13); | 211 | clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13); |
@@ -165,6 +214,7 @@ int __init mx25_clocks_init(void) | |||
165 | clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16); | 214 | clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16); |
166 | clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17); | 215 | clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17); |
167 | clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18); | 216 | clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18); |
217 | /* CCM_CGCR2(19): reserved in datasheet, but used as wdt in FSL kernel */ | ||
168 | clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19); | 218 | clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19); |
169 | 219 | ||
170 | for (i = 0; i < ARRAY_SIZE(clk); i++) | 220 | for (i = 0; i < ARRAY_SIZE(clk); i++) |
@@ -172,6 +222,18 @@ int __init mx25_clocks_init(void) | |||
172 | pr_err("i.MX25 clk %d: register failed with %ld\n", | 222 | pr_err("i.MX25 clk %d: register failed with %ld\n", |
173 | i, PTR_ERR(clk[i])); | 223 | i, PTR_ERR(clk[i])); |
174 | 224 | ||
225 | clk_prepare_enable(clk[emi_ahb]); | ||
226 | |||
227 | clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); | ||
228 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | int __init mx25_clocks_init(void) | ||
234 | { | ||
235 | __mx25_clocks_init(24000000); | ||
236 | |||
175 | /* i.mx25 has the i.mx21 type uart */ | 237 | /* i.mx25 has the i.mx21 type uart */ |
176 | clk_register_clkdev(clk[uart1_ipg], "ipg", "imx21-uart.0"); | 238 | clk_register_clkdev(clk[uart1_ipg], "ipg", "imx21-uart.0"); |
177 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.0"); | 239 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.0"); |
@@ -183,8 +245,6 @@ int __init mx25_clocks_init(void) | |||
183 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.3"); | 245 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.3"); |
184 | clk_register_clkdev(clk[uart5_ipg], "ipg", "imx21-uart.4"); | 246 | clk_register_clkdev(clk[uart5_ipg], "ipg", "imx21-uart.4"); |
185 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.4"); | 247 | clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.4"); |
186 | clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); | ||
187 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); | ||
188 | clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0"); | 248 | clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0"); |
189 | clk_register_clkdev(clk[usbotg_ahb], "ahb", "mxc-ehci.0"); | 249 | clk_register_clkdev(clk[usbotg_ahb], "ahb", "mxc-ehci.0"); |
190 | clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0"); | 250 | clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0"); |
@@ -242,5 +302,40 @@ int __init mx25_clocks_init(void) | |||
242 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); | 302 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); |
243 | 303 | ||
244 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); | 304 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); |
305 | |||
306 | return 0; | ||
307 | } | ||
308 | |||
309 | int __init mx25_clocks_init_dt(void) | ||
310 | { | ||
311 | struct device_node *np; | ||
312 | void __iomem *base; | ||
313 | int irq; | ||
314 | unsigned long osc_rate = 24000000; | ||
315 | |||
316 | /* retrieve the freqency of fixed clocks from device tree */ | ||
317 | for_each_compatible_node(np, NULL, "fixed-clock") { | ||
318 | u32 rate; | ||
319 | if (of_property_read_u32(np, "clock-frequency", &rate)) | ||
320 | continue; | ||
321 | |||
322 | if (of_device_is_compatible(np, "fsl,imx-osc")) | ||
323 | osc_rate = rate; | ||
324 | } | ||
325 | |||
326 | np = of_find_compatible_node(NULL, NULL, "fsl,imx25-ccm"); | ||
327 | clk_data.clks = clk; | ||
328 | clk_data.clk_num = ARRAY_SIZE(clk); | ||
329 | of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); | ||
330 | |||
331 | __mx25_clocks_init(osc_rate); | ||
332 | |||
333 | np = of_find_compatible_node(NULL, NULL, "fsl,imx25-gpt"); | ||
334 | base = of_iomap(np, 0); | ||
335 | WARN_ON(!base); | ||
336 | irq = irq_of_parse_and_map(np, 0); | ||
337 | |||
338 | mxc_timer_init(base, irq); | ||
339 | |||
245 | return 0; | 340 | return 0; |
246 | } | 341 | } |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 448476958e7f..7f2c10c7413a 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -424,6 +424,7 @@ int __init mx6q_clocks_init(void) | |||
424 | clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); | 424 | clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); |
425 | clk_register_clkdev(clk[ahb], "ahb", NULL); | 425 | clk_register_clkdev(clk[ahb], "ahb", NULL); |
426 | clk_register_clkdev(clk[cko1], "cko1", NULL); | 426 | clk_register_clkdev(clk[cko1], "cko1", NULL); |
427 | clk_register_clkdev(clk[arm], NULL, "cpu0"); | ||
427 | 428 | ||
428 | /* | 429 | /* |
429 | * The gpmi needs 100MHz frequency in the EDO/Sync mode, | 430 | * The gpmi needs 100MHz frequency in the EDO/Sync mode, |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index ef8db6b34841..7191ab4434e5 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -66,6 +66,7 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc, | |||
66 | unsigned long ckih1, unsigned long ckih2); | 66 | unsigned long ckih1, unsigned long ckih2); |
67 | extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, | 67 | extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, |
68 | unsigned long ckih1, unsigned long ckih2); | 68 | unsigned long ckih1, unsigned long ckih2); |
69 | extern int mx25_clocks_init_dt(void); | ||
69 | extern int mx27_clocks_init_dt(void); | 70 | extern int mx27_clocks_init_dt(void); |
70 | extern int mx31_clocks_init_dt(void); | 71 | extern int mx31_clocks_init_dt(void); |
71 | extern int mx51_clocks_init_dt(void); | 72 | extern int mx51_clocks_init_dt(void); |
diff --git a/arch/arm/mach-imx/imx25-dt.c b/arch/arm/mach-imx/imx25-dt.c new file mode 100644 index 000000000000..e17dfbc42192 --- /dev/null +++ b/arch/arm/mach-imx/imx25-dt.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Sascha Hauer, Pengutronix | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | */ | ||
11 | |||
12 | #include <linux/irq.h> | ||
13 | #include <linux/of_irq.h> | ||
14 | #include <linux/of_platform.h> | ||
15 | #include <asm/mach/arch.h> | ||
16 | #include <asm/mach/time.h> | ||
17 | #include "common.h" | ||
18 | #include "mx25.h" | ||
19 | |||
20 | static void __init imx25_dt_init(void) | ||
21 | { | ||
22 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
23 | } | ||
24 | |||
25 | static void __init imx25_timer_init(void) | ||
26 | { | ||
27 | mx25_clocks_init_dt(); | ||
28 | } | ||
29 | |||
30 | static struct sys_timer imx25_timer = { | ||
31 | .init = imx25_timer_init, | ||
32 | }; | ||
33 | |||
34 | static const char * const imx25_dt_board_compat[] __initconst = { | ||
35 | "fsl,imx25", | ||
36 | NULL | ||
37 | }; | ||
38 | |||
39 | DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") | ||
40 | .map_io = mx25_map_io, | ||
41 | .init_early = imx25_init_early, | ||
42 | .init_irq = mx25_init_irq, | ||
43 | .handle_irq = imx25_handle_irq, | ||
44 | .timer = &imx25_timer, | ||
45 | .init_machine = imx25_dt_init, | ||
46 | .dt_compat = imx25_dt_board_compat, | ||
47 | .restart = mxc_restart, | ||
48 | MACHINE_END | ||
diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c index 5f1510363ee7..2fdc9bf2fb5e 100644 --- a/arch/arm/mach-imx/lluart.c +++ b/arch/arm/mach-imx/lluart.c | |||
@@ -17,17 +17,25 @@ | |||
17 | 17 | ||
18 | #include "hardware.h" | 18 | #include "hardware.h" |
19 | 19 | ||
20 | #define IMX6Q_UART1_BASE_ADDR 0x02020000 | ||
21 | #define IMX6Q_UART2_BASE_ADDR 0x021e8000 | ||
22 | #define IMX6Q_UART3_BASE_ADDR 0x021ec000 | ||
23 | #define IMX6Q_UART4_BASE_ADDR 0x021f0000 | ||
24 | #define IMX6Q_UART5_BASE_ADDR 0x021f4000 | ||
25 | |||
26 | /* | ||
27 | * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion | ||
28 | * of IMX6Q_UART##n##_BASE_ADDR. | ||
29 | */ | ||
30 | #define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR | ||
31 | #define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n) | ||
32 | #define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT) | ||
33 | |||
20 | static struct map_desc imx_lluart_desc = { | 34 | static struct map_desc imx_lluart_desc = { |
21 | #ifdef CONFIG_DEBUG_IMX6Q_UART2 | 35 | #ifdef CONFIG_DEBUG_IMX6Q_UART |
22 | .virtual = MX6Q_IO_P2V(MX6Q_UART2_BASE_ADDR), | 36 | .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE), |
23 | .pfn = __phys_to_pfn(MX6Q_UART2_BASE_ADDR), | 37 | .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE), |
24 | .length = MX6Q_UART2_SIZE, | 38 | .length = 0x4000, |
25 | .type = MT_DEVICE, | ||
26 | #endif | ||
27 | #ifdef CONFIG_DEBUG_IMX6Q_UART4 | ||
28 | .virtual = MX6Q_IO_P2V(MX6Q_UART4_BASE_ADDR), | ||
29 | .pfn = __phys_to_pfn(MX6Q_UART4_BASE_ADDR), | ||
30 | .length = MX6Q_UART4_SIZE, | ||
31 | .type = MT_DEVICE, | 39 | .type = MT_DEVICE, |
32 | #endif | 40 | #endif |
33 | }; | 41 | }; |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index cce33e433bd1..4eb1b3ac794c 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -38,6 +38,40 @@ | |||
38 | #include "cpuidle.h" | 38 | #include "cpuidle.h" |
39 | #include "hardware.h" | 39 | #include "hardware.h" |
40 | 40 | ||
41 | #define IMX6Q_ANALOG_DIGPROG 0x260 | ||
42 | |||
43 | static int imx6q_revision(void) | ||
44 | { | ||
45 | struct device_node *np; | ||
46 | void __iomem *base; | ||
47 | static u32 rev; | ||
48 | |||
49 | if (!rev) { | ||
50 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); | ||
51 | if (!np) | ||
52 | return IMX_CHIP_REVISION_UNKNOWN; | ||
53 | base = of_iomap(np, 0); | ||
54 | if (!base) { | ||
55 | of_node_put(np); | ||
56 | return IMX_CHIP_REVISION_UNKNOWN; | ||
57 | } | ||
58 | rev = readl_relaxed(base + IMX6Q_ANALOG_DIGPROG); | ||
59 | iounmap(base); | ||
60 | of_node_put(np); | ||
61 | } | ||
62 | |||
63 | switch (rev & 0xff) { | ||
64 | case 0: | ||
65 | return IMX_CHIP_REVISION_1_0; | ||
66 | case 1: | ||
67 | return IMX_CHIP_REVISION_1_1; | ||
68 | case 2: | ||
69 | return IMX_CHIP_REVISION_1_2; | ||
70 | default: | ||
71 | return IMX_CHIP_REVISION_UNKNOWN; | ||
72 | } | ||
73 | } | ||
74 | |||
41 | void imx6q_restart(char mode, const char *cmd) | 75 | void imx6q_restart(char mode, const char *cmd) |
42 | { | 76 | { |
43 | struct device_node *np; | 77 | struct device_node *np; |
@@ -204,6 +238,7 @@ static void __init imx6q_timer_init(void) | |||
204 | { | 238 | { |
205 | mx6q_clocks_init(); | 239 | mx6q_clocks_init(); |
206 | twd_local_timer_of_register(); | 240 | twd_local_timer_of_register(); |
241 | imx_print_silicon_rev("i.MX6Q", imx6q_revision()); | ||
207 | } | 242 | } |
208 | 243 | ||
209 | static struct sys_timer imx6q_timer = { | 244 | static struct sys_timer imx6q_timer = { |
diff --git a/arch/arm/mach-imx/mx6q.h b/arch/arm/mach-imx/mx6q.h index f7e7dbac8f4b..19d3f54db5af 100644 --- a/arch/arm/mach-imx/mx6q.h +++ b/arch/arm/mach-imx/mx6q.h | |||
@@ -27,9 +27,5 @@ | |||
27 | #define MX6Q_CCM_SIZE 0x4000 | 27 | #define MX6Q_CCM_SIZE 0x4000 |
28 | #define MX6Q_ANATOP_BASE_ADDR 0x020c8000 | 28 | #define MX6Q_ANATOP_BASE_ADDR 0x020c8000 |
29 | #define MX6Q_ANATOP_SIZE 0x1000 | 29 | #define MX6Q_ANATOP_SIZE 0x1000 |
30 | #define MX6Q_UART2_BASE_ADDR 0x021e8000 | ||
31 | #define MX6Q_UART2_SIZE 0x4000 | ||
32 | #define MX6Q_UART4_BASE_ADDR 0x021f0000 | ||
33 | #define MX6Q_UART4_SIZE 0x4000 | ||
34 | 30 | ||
35 | #endif /* __MACH_MX6Q_H__ */ | 31 | #endif /* __MACH_MX6Q_H__ */ |