Skip to contentSkip to conversation

ARM: imx6q: add DT node for apbh-dma

PATCH New Huang Shijie 4 participants 13 messages May 24, 2012 – May 25, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ARM: imx6q: add DT node for apbh-dma

add DT node for apbh-dma.

---
 arch/arm/boot/dts/imx6q.dtsi |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q.dtsi +5 -0
index 8c90cba..cccac33 100644
@@ -87,6 +87,11 @@
 		interrupt-parent = <&intc>;
 		ranges;
 
+		dma-apbh at 00110000 {
+			compatible = "fsl,imx6q-dma-apbh";
+			reg = <0x00110000 0x2000>;
+		};
+
 		timer at 00a00600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x00a00600 0x20>;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/5 ARM: imx6q: add clock for apbh-dma

add the clock for apbh-dma.

---
 arch/arm/mach-imx/clk-imx6q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +2 -1
index cab02d0..12d9040 100644
@@ -318,7 +318,7 @@ int __init mx6q_clocks_init(void)
 	clk[ahb]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
 
 	/*                                name             parent_name          reg         shift */
-	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "ahb",               base + 0x68, 4);
+	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);
 	clk[asrc]         = imx_clk_gate2("asrc",          "asrc_podf",         base + 0x68, 6);
 	clk[can1_ipg]     = imx_clk_gate2("can1_ipg",      "ipg",               base + 0x68, 14);
 	clk[can1_serial]  = imx_clk_gate2("can1_serial",   "can_root",          base + 0x68, 16);
@@ -393,6 +393,7 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
 	clk_register_clkdev(clk[twd], NULL, "smp_twd");
 	clk_register_clkdev(clk[usboh3], NULL, "usboh3");
+	clk_register_clkdev(clk[apbh_dma], NULL, "110000.dma-apbh");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.0.4
maintainer
#2 lore raw

PATCH 2/5 ARM: imx6q: add clock for apbh-dma

Quoted 12 lines · Huang Shijie

add the clock for apbh-dma.

---
 arch/arm/mach-imx/clk-imx6q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +0 -0
index cab02d0..12d9040 100644

arch/arm/mach-imx/clk-imx6q.c int __init mx6q_clocks_init(void) · line 321

Quoted 5 lines
arch/arm/mach-imx/clk-imx6q.c +1 -1
@@ -318,7 +318,7 @@ int __init mx6q_clocks_init(void)
 	clk[ahb]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
 
 	/*                                name             parent_name          reg         shift */
-	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "ahb",               base + 0x68, 4);
+	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);

This change looks strange. Is this correct?

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw

PATCH 2/5 ARM: imx6q: add clock for apbh-dma

? 2012?05?25? 01:30, Sascha Hauer ??:

Quoted 15 lines · Huang Shijie
Quoted 14 lines

add the clock for apbh-dma.

---
  arch/arm/mach-imx/clk-imx6q.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +0 -0
index cab02d0..12d9040 100644
@@ -318,7 +318,7 @@ int __init mx6q_clocks_init(void)
  	clk[ahb]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
 
Quoted 4 lines

arch/arm/mach-imx/clk-imx6q.c int __init mx6q_clocks_init(void) · line 321

Quoted 3 lines
arch/arm/mach-imx/clk-imx6q.c +1 -1
  	/*                                name             parent_name          reg         shift */
-	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "ahb",               base + 0x68, 4);
+	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);

This change looks strange. Is this correct?

yes. it's correct.

The datasheet about the clock tells us the parent of the apbh-dma is usdhc3.

Best Regards
Huang Shijie

Quoted 3 lines

Sascha

#4 lore raw

PATCH 2/5 ARM: imx6q: add clock for apbh-dma

Quoted 16 lines · Huang Shijie

? 2012?05?25? 01:30, Sascha Hauer ??:

Quoted 15 lines · Huang Shijie
Quoted 14 lines

add the clock for apbh-dma.

---
 arch/arm/mach-imx/clk-imx6q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +0 -0
index cab02d0..12d9040 100644
@@ -318,7 +318,7 @@ int __init mx6q_clocks_init(void)
 	clk[ahb]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
 
Quoted 8 lines
Quoted 4 lines

arch/arm/mach-imx/clk-imx6q.c int __init mx6q_clocks_init(void) · line 321

Quoted 3 lines
arch/arm/mach-imx/clk-imx6q.c +1 -1
 	/*                                name             parent_name          reg         shift */
-	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "ahb",               base + 0x68, 4);
+	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);

This change looks strange. Is this correct?

yes. it's correct.

The datasheet about the clock tells us the parent of the apbh-dma is usdhc3.

I guess it's a hardware bug.

Signature · 2 lines
Regards,
Shawn
maintainer
#5 lore raw

PATCH 2/5 ARM: imx6q: add clock for apbh-dma

In reply to Huang Shijie
Quoted 16 lines · Huang Shijie

? 2012?05?25? 01:30, Sascha Hauer ??:

Quoted 15 lines · Huang Shijie
Quoted 14 lines

add the clock for apbh-dma.

---
 arch/arm/mach-imx/clk-imx6q.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +0 -0
index cab02d0..12d9040 100644
@@ -318,7 +318,7 @@ int __init mx6q_clocks_init(void)
 	clk[ahb]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
 
Quoted 7 lines
Quoted 4 lines

arch/arm/mach-imx/clk-imx6q.c int __init mx6q_clocks_init(void) · line 321

Quoted 3 lines
arch/arm/mach-imx/clk-imx6q.c +1 -1
 	/*                                name             parent_name          reg         shift */
-	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "ahb",               base + 0x68, 4);
+	clk[apbh_dma]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);

This change looks strange. Is this correct?

yes. it's correct.

The datasheet about the clock tells us the parent of the apbh-dma is usdhc3.

Ok then, just wanted to make sure this is no patching accident.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

PATCH 3/5 dma: mxs-dma: enable apbh-dma for imx6q

In reply to Huang Shijie

enable the apbh-dma for imx6q.

---
 drivers/dma/Kconfig   |    2 +-
 drivers/dma/mxs-dma.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/dma/Kconfig +1 -1
index aadeb5b..c8416d5 100644
@@ -237,7 +237,7 @@ config IMX_DMA
 
 config MXS_DMA
 	bool "MXS DMA support"
-	depends on SOC_IMX23 || SOC_IMX28
+	depends on SOC_IMX23 || SOC_IMX28 || SOC_IMX6Q
 	select STMP_DEVICE
 	select DMA_ENGINE
 	help
drivers/dma/mxs-dma.c +8 -1
index c96ab15..f41eb9e 100644
@@ -29,7 +29,6 @@
 #include <linux/of_device.h>
 
 #include <asm/irq.h>
-#include <mach/mxs.h>
 
 #include "dmaengine.h"
 
@@ -129,6 +128,7 @@ enum mxs_dma_devtype {
 enum mxs_dma_id {
 	IMX23_DMA,
 	IMX28_DMA,
+	IMX6Q_DMA,
 };
 
 struct mxs_dma_engine {
@@ -159,6 +159,9 @@ static struct mxs_dma_type mxs_dma_types[] = {
 	}, {
 		.id = IMX28_DMA,
 		.type = MXS_DMA_APBX,
+	}, {
+		.id = IMX6Q_DMA,
+		.type = MXS_DMA_APBH,
 	}
 };
 
@@ -176,6 +179,9 @@ static struct platform_device_id mxs_dma_ids[] = {
 		.name = "imx28-dma-apbx",
 		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
 	}, {
+		.name = "imx6q-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[4],
+	}, {
 		/* end of list */
 	}
 };
@@ -185,6 +191,7 @@ static const struct of_device_id mxs_dma_dt_ids[] = {
 	{ .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
 	{ .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
 	{ .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
+	{ .compatible = "fsl,imx6q-dma-apbh", .data = &mxs_dma_ids[4], },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
Signature · 1 line
1.7.0.4
#7 lore raw

PATCH 3/5 dma: mxs-dma: enable apbh-dma for imx6q

Quoted 7 lines · Huang Shijie

enable the apbh-dma for imx6q.

---
 drivers/dma/Kconfig   |    2 +-
 drivers/dma/mxs-dma.c |    9 ++++++++-

As I commented on dts change, you do not need to patch drivers/dma/mxs-dma.c at all, since the IP block on imx6q is compatible with imx28 with no need of any tweaking. All you need to do is put imx28 compatible string at the end of imx6q one, and the driver will simply work for imx6q. That's the whole point of DT compatible property.

Regards,
Shawn

Quoted 67 lines
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/dma/Kconfig +1 -1
index aadeb5b..c8416d5 100644
@@ -237,7 +237,7 @@ config IMX_DMA
 
 config MXS_DMA
 	bool "MXS DMA support"
-	depends on SOC_IMX23 || SOC_IMX28
+	depends on SOC_IMX23 || SOC_IMX28 || SOC_IMX6Q
 	select STMP_DEVICE
 	select DMA_ENGINE
 	help
drivers/dma/mxs-dma.c +8 -1
index c96ab15..f41eb9e 100644
@@ -29,7 +29,6 @@
 #include <linux/of_device.h>
 
 #include <asm/irq.h>
-#include <mach/mxs.h>
 
 #include "dmaengine.h"
 
@@ -129,6 +128,7 @@ enum mxs_dma_devtype {
 enum mxs_dma_id {
 	IMX23_DMA,
 	IMX28_DMA,
+	IMX6Q_DMA,
 };
 
 struct mxs_dma_engine {
@@ -159,6 +159,9 @@ static struct mxs_dma_type mxs_dma_types[] = {
 	}, {
 		.id = IMX28_DMA,
 		.type = MXS_DMA_APBX,
+	}, {
+		.id = IMX6Q_DMA,
+		.type = MXS_DMA_APBH,
 	}
 };
 
@@ -176,6 +179,9 @@ static struct platform_device_id mxs_dma_ids[] = {
 		.name = "imx28-dma-apbx",
 		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
 	}, {
+		.name = "imx6q-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[4],
+	}, {
 		/* end of list */
 	}
 };
@@ -185,6 +191,7 @@ static const struct of_device_id mxs_dma_dt_ids[] = {
 	{ .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
 	{ .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
 	{ .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
+	{ .compatible = "fsl,imx6q-dma-apbh", .data = &mxs_dma_ids[4], },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
Signature · 1 line
1.7.0.4
#8 lore raw

PATCH 4/5 ARM: imx6q: add DT node for gpmi-nand

In reply to Huang Shijie

Add DT node for gpmi-nand.
Also enable the gpmi-nand for mx6q-arm2 board.

---
 arch/arm/boot/dts/imx6q-arm2.dts |    4 ++++
 arch/arm/boot/dts/imx6q.dtsi     |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q-arm2.dts +4 -0
index db4c609..15f9e0b 100644
@@ -22,6 +22,10 @@
 	};
 
 	soc {
+		gpmi-nand at 00112000 {
+			status = "okay";
+		};
+
 		aips-bus at 02100000 { /* AIPS2 */
 			ethernet at 02188000 {
 				phy-mode = "rgmii";
arch/arm/boot/dts/imx6q.dtsi +12 -0
index cccac33..979d9f9 100644
@@ -92,6 +92,18 @@
 			reg = <0x00110000 0x2000>;
 		};
 
+		gpmi-nand at 00112000 {
+			compatible = "fsl,imx6q-gpmi-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
+			reg-names = "gpmi-nand", "bch";
+			interrupts = <0 13 0x04>, <0 15 0x04>;
+			interrupt-names = "gpmi-dma", "bch";
+			fsl,gpmi-dma-channel = <0>;
+			status = "disabled";
+		};
+
 		timer at 00a00600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x00a00600 0x20>;
Signature · 1 line
1.7.0.4
#9 lore raw

PATCH 4/5 ARM: imx6q: add DT node for gpmi-nand

Quoted 14 lines · Huang Shijie

Add DT node for gpmi-nand.
Also enable the gpmi-nand for mx6q-arm2 board.

---
 arch/arm/boot/dts/imx6q-arm2.dts |    4 ++++
 arch/arm/boot/dts/imx6q.dtsi     |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q-arm2.dts +0 -0
index db4c609..15f9e0b 100644

arch/arm/boot/dts/imx6q-arm2.dts line 25

Quoted 4 lines
arch/arm/boot/dts/imx6q-arm2.dts +1 -0
@@ -22,6 +22,10 @@
 	};
 
 	soc {
+		gpmi-nand at 00112000 {

Missing pinctrl setup?

Quoted 3 lines
arch/arm/boot/dts/imx6q-arm2.dts +3 -0
+			status = "okay";
+		};
+
Signature · 2 lines
Regards,
Shawn
#10 lore raw

PATCH 5/5 ARM: imx6q: add clocks for gpmi-nand

In reply to Huang Shijie

add the clocks for gpmi-nand.

---
 arch/arm/mach-imx/clk-imx6q.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-imx/clk-imx6q.c +3 -1
index 12d9040..2b5ab5f 100644
@@ -151,7 +151,7 @@ enum mx6q_clks {
 	esai, gpt_ipg, gpt_ipg_per, gpu2d_core, gpu3d_core, hdmi_iahb,
 	hdmi_isfr, i2c1, i2c2, i2c3, iim, enfc, ipu1, ipu1_di0, ipu1_di1, ipu2,
 	ipu2_di0, ldb_di0, ldb_di1, ipu2_di1, hsi_tx, mlb, mmdc_ch0_axi,
-	mmdc_ch1_axi, ocram, openvg_axi, pcie_axi, pwm1, pwm2, pwm3, pwm4,
+	mmdc_ch1_axi, ocram, openvg_axi, pcie_axi, pwm1, pwm2, pwm3, pwm4, per1_bch,
 	gpmi_bch_apb, gpmi_bch, gpmi_io, gpmi_apb, sata, sdma, spba, ssi1,
 	ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
 	usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
@@ -357,6 +357,7 @@ int __init mx6q_clocks_init(void)
 	clk[ocram]        = imx_clk_gate2("ocram",         "ahb",               base + 0x74, 28);
 	clk[openvg_axi]   = imx_clk_gate2("openvg_axi",    "axi",               base + 0x74, 30);
 	clk[pcie_axi]     = imx_clk_gate2("pcie_axi",      "pcie_axi_sel",      base + 0x78, 0);
+	clk[per1_bch]     = imx_clk_gate2("per1_bch",      "usdhc3",            base + 0x78, 12);
 	clk[pwm1]         = imx_clk_gate2("pwm1",          "ipg_per",           base + 0x78, 16);
 	clk[pwm2]         = imx_clk_gate2("pwm2",          "ipg_per",           base + 0x78, 18);
 	clk[pwm3]         = imx_clk_gate2("pwm3",          "ipg_per",           base + 0x78, 20);
@@ -394,6 +395,7 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[twd], NULL, "smp_twd");
 	clk_register_clkdev(clk[usboh3], NULL, "usboh3");
 	clk_register_clkdev(clk[apbh_dma], NULL, "110000.dma-apbh");
+	clk_register_clkdev(clk[gpmi_io], NULL, "112000.gpmi-nand");
 	clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
 	clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
 	clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH 1/5 ARM: imx6q: add DT node for apbh-dma

In reply to Huang Shijie
Quoted 12 lines · Huang Shijie

add DT node for apbh-dma.

---
 arch/arm/boot/dts/imx6q.dtsi |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q.dtsi +0 -0
index 8c90cba..cccac33 100644

arch/arm/boot/dts/imx6q.dtsi line 91

Quoted 5 lines
arch/arm/boot/dts/imx6q.dtsi +2 -0
@@ -87,6 +87,11 @@
 		interrupt-parent = <&intc>;
 		ranges;
 
+		dma-apbh at 00110000 {
+			compatible = "fsl,imx6q-dma-apbh";

I guess imx6q-dma-apbh is compatible with imx28-dma-apbh. In that case, you need something like below.

			compatible = "fsl,imx6q-dma-apbh", "imx28-dma-apbh";

Then you do not need to patch mxs-dma.c at all.

Regards,
Shawn

Quoted 6 lines
arch/arm/boot/dts/imx6q.dtsi +3 -0
+			reg = <0x00110000 0x2000>;
+		};
+
 		timer at 00a00600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x00a00600 0x20>;
#12 lore raw

PATCH 1/5 ARM: imx6q: add DT node for apbh-dma

Quoted 22 lines · Shawn Guo
Quoted 12 lines · Huang Shijie

add DT node for apbh-dma.

---
?arch/arm/boot/dts/imx6q.dtsi | ? ?5 +++++
?1 files changed, 5 insertions(+), 0 deletions(-)

arch/arm/boot/dts/imx6q.dtsi +0 -0
index 8c90cba..cccac33 100644

arch/arm/boot/dts/imx6q.dtsi line 91

Quoted 5 lines
arch/arm/boot/dts/imx6q.dtsi +2 -0
@@ -87,6 +87,11 @@
 ? ? ? ? ? ? ? interrupt-parent = <&intc>;
 ? ? ? ? ? ? ? ranges;
 
+ ? ? ? ? ? ? dma-apbh at 00110000 {
+ ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx6q-dma-apbh";

I guess imx6q-dma-apbh is compatible with imx28-dma-apbh. ?In that case, you need something like below.

Quoted 3 lines

? ? ? ? ? ? ? ? ? ? ? ?compatible = "fsl,imx6q-dma-apbh", "imx28-dma-apbh";

Then you do not need to patch mxs-dma.c at all.

thanks a lot.

Huang Shijie

Quoted 15 lines

Regards,
Shawn

arch/arm/boot/dts/imx6q.dtsi line 97

Quoted 6 lines
arch/arm/boot/dts/imx6q.dtsi +3 -0
+ ? ? ? ? ? ? ? ? ? ? reg = <0x00110000 0x2000>;
+ ? ? ? ? ? ? };
+
 ? ? ? ? ? ? ? timer at 00a00600 {
 ? ? ? ? ? ? ? ? ? ? ? compatible = "arm,cortex-a9-twd-timer";
 ? ? ? ? ? ? ? ? ? ? ? reg = <0x00a00600 0x20>;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel