Skip to contentSkip to conversation

i.MX25 devicetree support

PATCH New Sascha Hauer 3 participants 6 messages Sep 24, 2012 – Sep 25, 2012

Subsystems (6)
lore
Share & tools
lore

Sascha Hauer

author maintainer
#0 lore raw

PATCH 1/1 i.MX25 devicetree support

The following adds devicetree support for the i.MX25. The devicetree should be fairly complete. The support uses the same clock binding Shawn already uses for i.MX6, No pinctrl supported (yet).

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
ARM i.MX25: Add devicetree support
ARM i.MX25: Add devicetree

 .../devicetree/bindings/clock/imx25-clock.txt      |  121 +++++
 arch/arm/boot/dts/imx25.dtsi                       |  469 ++++++++++++++++++++
 arch/arm/mach-imx/Kconfig                          |    7 +
 arch/arm/mach-imx/Makefile                         |    1 +
 arch/arm/mach-imx/clk-imx25.c                      |   56 ++-
 arch/arm/mach-imx/imx25-dt.c                       |   48 ++
 arch/arm/plat-mxc/include/mach/common.h            |    1 +
 7 files changed, 699 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/imx25-clock.txt
 create mode 100644 arch/arm/boot/dts/imx25.dtsi
 create mode 100644 arch/arm/mach-imx/imx25-dt.c
author maintainer
#1 lore raw

PATCH 1/2 ARM i.MX25: Add devicetree support

This adds a i.MX25 dt machine descriptor and changes the clock support to optionally initialize from dt.

---
 arch/arm/mach-imx/Kconfig               |    7 ++++
 arch/arm/mach-imx/Makefile              |    1 +
 arch/arm/mach-imx/clk-imx25.c           |   56 ++++++++++++++++++++++++++++---
 arch/arm/mach-imx/imx25-dt.c            |   48 ++++++++++++++++++++++++++
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 5 files changed, 109 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-imx/imx25-dt.c
arch/arm/mach-imx/Kconfig +7 -0
index afd542a..f5450c7 100644
@@ -200,6 +200,13 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
 
 endchoice
 
+config MACH_IMX25_DT
+	bool "Support i.MX25 platforms from device tree"
+	select SOC_IMX25
+	help
+	  Include support for Freescale i.MX25 based platforms
+	  using the device tree for discovery
+
 comment "MX27 platforms:"
 
 config MACH_MX27ADS
arch/arm/mach-imx/Makefile +1 -0
index d004d37..3cff403 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
 obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o
 obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o
 obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o
+obj-$(CONFIG_MACH_IMX25_DT) += imx25-dt.o
 
 # i.MX27 based machines
 obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o
arch/arm/mach-imx/clk-imx25.c +52 -4

95 lines not on this page · raw message

arch/arm/mach-imx/imx25-dt.c new file +48 -0

48 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/common.h +1 -0
index 7128e97..2b4dead 100644
@@ -67,6 +67,7 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
 			unsigned long ckih1, unsigned long ckih2);
 extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
 			unsigned long ckih1, unsigned long ckih2);
+extern int mx25_clocks_init_dt(void);
 extern int mx27_clocks_init_dt(void);
 extern int mx31_clocks_init_dt(void);
 extern int mx51_clocks_init_dt(void);
Signature · 1 line
1.7.10.4
author maintainer
#3 lore raw

PATCH 2/2 ARM i.MX25: Add devicetree

In reply to Sascha Hauer

This adds a i.MX25 dtsi file along with the i.MX25 clock tree documentation. The devicetree should be fairly complete for:

- uart
- fec
- i2c
- spi
- pwm
- nand
- gpio
- wdog
- esdhc
- flexcan

The more exotic devices currently miss clock bindings.

---
 .../devicetree/bindings/clock/imx25-clock.txt      |  121 +++++
 arch/arm/boot/dts/imx25.dtsi                       |  469 ++++++++++++++++++++
 2 files changed, 590 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/imx25-clock.txt
 create mode 100644 arch/arm/boot/dts/imx25.dtsi
Documentation/devicetree/bindings/clock/imx25-clock.txt new file +121 -0
new file mode 100644
index 0000000..e7b1d2c
@@ -0,0 +1,121 @@
+* Clock bindings for Freescale i.MX25
+
+Required properties:
+- compatible: Should be "fsl,imx25-ccm"
+- reg: Address and length of the register set
+- interrupts: Should contain CCM interrupt
+- #clock-cells: Should be <1>
+
+The clock consumer should specify the desired clock by having the clock
+ID in its "clocks" phandle cell.  The following is a full list of i.MX6Q
+clocks and IDs.
+
+	Clock			ID
+	---------------------------
+	dummy			0
+	osc			1
+	mpll			2
+	upll			3
+	mpll_cpu_3_4		4
+	cpu_sel			5
+	cpu			6
+	ahb			7
+	usb_div			8
+	ipg			9
+	per0_sel		10
+	per1_sel		11
+	per2_sel		12
+	per3_sel		13
+	per4_sel		14
+	per5_sel		15
+	per6_sel		16
+	per7_sel		17
+	per8_sel		18
+	per9_sel		19
+	per10_sel		20
+	per11_sel		21
+	per12_sel		22
+	per13_sel		23
+	per14_sel		24
+	per15_sel		25
+	per0			26
+	per1			27
+	per2			28
+	per3			29
+	per4			30
+	per5			31
+	per6			32
+	per7			33
+	per8			34
+	per9			35
+	per10			36
+	per11			37
+	per12			38
+	per13			39
+	per14			40
+	per15			41
+	csi_ipg_per		42
+	esdhc1_ipg_per		43
+	esdhc2_ipg_per		44
+	gpt_ipg_per		45
+	i2c_ipg_per		46
+	lcdc_ipg_per		47
+	nfc_ipg_per		48
+	ssi1_ipg_per		49
+	ssi2_ipg_per		50
+	uart_ipg_per		51
+	csi_ahb			52
+	esdhc1_ahb		53
+	esdhc2_ahb		54
+	fec_ahb			55
+	lcdc_ahb		56
+	sdma_ahb		57
+	usbotg_ahb		58
+	can1_ipg		59
+	can2_ipg		60
+	csi_ipg			61
+	cspi1_ipg		62
+	cspi2_ipg		63
+	cspi3_ipg		64
+	dryice_ipg		65
+	esdhc1_ipg		66
+	esdhc2_ipg		67
+	fec_ipg			68
+	iim_ipg			69
+	kpp_ipg			70
+	lcdc_ipg		71
+	pwm1_ipg		72
+	pwm2_ipg		73
+	pwm3_ipg		74
+	pwm4_ipg		75
+	sdma_ipg		76
+	ssi1_ipg		77
+	ssi2_ipg		78
+	tsc_ipg			79
+	uart1_ipg		80
+	uart2_ipg		81
+	uart3_ipg		82
+	uart4_ipg		83
+	uart5_ipg		84
+	wdt_ipg			85
+
+Examples:
+
+clks: ccm at 53f80000 {
+	compatible = "fsl,imx25-ccm";
+	reg = <0x53f80000 0x4000>;
+	interrupts = <31>;
+	clock-output-names = ...
+			"uart_ipg",
+			"uart_serial",
+			...;
+};
+
+uart1: serial at 43f90000 {
+	compatible = "fsl,imx25-uart", "fsl,imx21-uart";
+	reg = <0x43f90000 0x4000>;
+	interrupts = <45>;
+	clocks = <&clks 79>, <&clks 50>;
+	clock-names = "ipg", "per";
+	status = "disabled";
+};
arch/arm/boot/dts/imx25.dtsi new file +469 -0

469 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 2/2 ARM i.MX25: Add devicetree

Hi Sascha,

Quoted 18 lines · Sascha Hauer

This adds a i.MX25 dtsi file along with the i.MX25 clock tree documentation. The devicetree should be fairly complete for:

- uart
- fec
- i2c
- spi
- pwm
- nand
- gpio
- wdog
- esdhc
- flexcan

The more exotic devices currently miss clock bindings.

---

[...]

Documentation/devicetree/bindings/clock/imx25-clock.txt line 11

Quoted 3 lines
Documentation/devicetree/bindings/clock/imx25-clock.txt new file +3 -0
+The clock consumer should specify the desired clock by having the clock
+ID in its "clocks" phandle cell.  The following is a full list of i.MX6Q
+clocks and IDs.

s/i.MX6Q/i.MX25/

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#5 lore raw

PATCH 2/2 ARM i.MX25: Add devicetree

In reply to Sascha Hauer
Quoted 14 lines · Sascha Hauer

This adds a i.MX25 dtsi file along with the i.MX25 clock tree documentation. The devicetree should be fairly complete for:

- uart
- fec
- i2c
- spi
- pwm
- nand
- gpio
- wdog
- esdhc
- flexcan

Quoted 3 lines

The more exotic devices currently miss clock bindings.

A couple of trivial comments below though.

<snip>

arch/arm/boot/dts/imx25.dtsi line 61

Quoted 4 lines
arch/arm/boot/dts/imx25.dtsi new file +4 -0
+			i2c1: i2c at 43f80000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx25-i2c", "fsl,imx1-i2c";

When the series gets rebased on imx multi-platform branch, the property needs to be:

				compatible = "fsl,imx25-i2c", "fsl,imx21-i2c";
Quoted 6 lines
arch/arm/boot/dts/imx25.dtsi new file +6 -0
+				reg = <0x43f80000 0x4000>;
+				clocks = <&clks 46>;
+				clock-names = "";
+				interrupts = <3>;
+				status = "disabled";
+			};

<snip>

arch/arm/boot/dts/imx25.dtsi line 459

Quoted 1 line
arch/arm/boot/dts/imx25.dtsi new file +1 -0
+		nand at bb000000 {

We can add a EMI node being parent of NAND to show how nand connects to SoC.

Shawn

Quoted 13 lines
arch/arm/boot/dts/imx25.dtsi new file +10 -0
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			compatible = "fsl,imx25-nand";
+			reg = <0xbb000000 0x2000>;
+			interrupts = <33>;
+			status = "disabled";
+		};
+	};
+};
Signature · 1 line
1.7.10.4