Skip to contentSkip to conversation

Some fixes and cleanup on imx-dma device registration

PATCH Superseded Shawn Guo 5 participants 24 messages Jun 13, 2011 – Jun 22, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

cover Some fixes and cleanup on imx-dma device registration

The patch set makes some small fixes on imx-dma device registration code, and then cleans up the code by breaking the concentrated imx-dma device registration into soc specific setup function. This is basically what gpio-mxc device registration is doing. In this way, we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list of soc family, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run.

Shawn Guo (6):
ARM: mxc: imx-sdma device gets 16K iosize than 4K
ARM: mxc: sdma on imx25 is a V2 block
ARM: mxc: change imx-dma default to_version to 1
ARM: mxc: imx-dma on imx25 has no other TO version but TO1
ARM: mxc: all three imx51 TOs use TO1 version of sdma script
ARM: mxc: clean up imx-dma device registration

 arch/arm/mach-imx/mm-imx21.c                    |    3 +
 arch/arm/mach-imx/mm-imx25.c                    |   26 +++
 arch/arm/mach-imx/mm-imx27.c                    |    3 +
 arch/arm/mach-imx/mm-imx31.c                    |   24 +++
 arch/arm/mach-imx/mm-imx35.c                    |   44 +++++
 arch/arm/mach-mx5/mm.c                          |   23 +++
 arch/arm/plat-mxc/devices.c                     |   16 ++-
 arch/arm/plat-mxc/devices/platform-imx-dma.c    |  204 ++---------------------
 arch/arm/plat-mxc/include/mach/devices-common.h |    6 +
 9 files changed, 157 insertions(+), 192 deletions(-)
author
#1 lore raw

PATCH 1/6 ARM: mxc: imx-sdma device gets 16K iosize than 4K

The sdma on all imx soc gets 16K IO space not 4K.

---
 arch/arm/plat-mxc/devices/platform-imx-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +1 -1
index b130f60..222e439 100644
@@ -57,7 +57,7 @@ static struct platform_device __init __maybe_unused *imx_add_imx_sdma(
 	struct resource res[] = {
 		{
 			.start = data->iobase,
-			.end = data->iobase + SZ_4K - 1,
+			.end = data->iobase + SZ_16K - 1,
 			.flags = IORESOURCE_MEM,
 		}, {
 			.start = data->irq,
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 2/6 ARM: mxc: sdma on imx25 is a V2 block

In reply to Shawn Guo

The sdma on soc imx25 is not a V1 but V2 block.

---
 arch/arm/plat-mxc/devices/platform-imx-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +1 -1
index 222e439..1c0ba53 100644
@@ -33,7 +33,7 @@ struct imx_imx_sdma_data {
 
 #ifdef CONFIG_SOC_IMX25
 struct imx_imx_sdma_data imx25_imx_sdma_data __initconst =
-	imx_imx_sdma_data_entry_single(MX25, 1, "imx25", 0);
+	imx_imx_sdma_data_entry_single(MX25, 2, "imx25", 0);
 #endif /* ifdef CONFIG_SOC_IMX25 */
 
 #ifdef CONFIG_SOC_IMX31
Signature · 1 line
1.7.4.1
author
#3 lore raw

PATCH 3/6 ARM: mxc: change imx-dma default to_version to 1

In reply to Shawn Guo

The value 0 is not a valid TO version number. With the current code, imx-sdma driver will try to load firmware sdma-imx25-to0.bin, which is obviously not a good name. Instead, sdma-imx25-to1.bin makes much more sense.

---
 arch/arm/plat-mxc/devices/platform-imx-dma.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +4 -4
index 1c0ba53..c2712b7 100644
@@ -33,22 +33,22 @@ struct imx_imx_sdma_data {
 
 #ifdef CONFIG_SOC_IMX25
 struct imx_imx_sdma_data imx25_imx_sdma_data __initconst =
-	imx_imx_sdma_data_entry_single(MX25, 2, "imx25", 0);
+	imx_imx_sdma_data_entry_single(MX25, 2, "imx25", 1);
 #endif /* ifdef CONFIG_SOC_IMX25 */
 
 #ifdef CONFIG_SOC_IMX31
 struct imx_imx_sdma_data imx31_imx_sdma_data __initdata =
-	imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 0);
+	imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 1);
 #endif /* ifdef CONFIG_SOC_IMX31 */
 
 #ifdef CONFIG_SOC_IMX35
 struct imx_imx_sdma_data imx35_imx_sdma_data __initdata =
-	imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 0);
+	imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 1);
 #endif /* ifdef CONFIG_SOC_IMX35 */
 
 #ifdef CONFIG_SOC_IMX51
 struct imx_imx_sdma_data imx51_imx_sdma_data __initconst =
-	imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 0);
+	imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 1);
 #endif /* ifdef CONFIG_SOC_IMX51 */
 
 static struct platform_device __init __maybe_unused *imx_add_imx_sdma(
Signature · 1 line
1.7.4.1
author
#4 lore raw

PATCH 4/6 ARM: mxc: imx-dma on imx25 has no other TO version but TO1

In reply to Shawn Guo

The imx25 sdma script only gets TO1 version, so there is no need to encode "to1" in the variable name.

---
 arch/arm/plat-mxc/devices/platform-imx-dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +2 -2
index c2712b7..c64f015 100644
@@ -77,7 +77,7 @@ static struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
 }
 
 #ifdef CONFIG_ARCH_MX25
-static struct sdma_script_start_addrs addr_imx25_to1 = {
+static struct sdma_script_start_addrs addr_imx25 = {
 	.ap_2_ap_addr = 729,
 	.uart_2_mcu_addr = 904,
 	.per_2_app_addr = 1255,
@@ -165,7 +165,7 @@ static int __init imxXX_add_imx_dma(void)
 
 #if defined(CONFIG_SOC_IMX25)
 	if (cpu_is_mx25()) {
-		imx25_imx_sdma_data.pdata.script_addrs = &addr_imx25_to1;
+		imx25_imx_sdma_data.pdata.script_addrs = &addr_imx25;
 		ret = imx_add_imx_sdma(&imx25_imx_sdma_data);
 	} else
 #endif
Signature · 1 line
1.7.4.1
author
#5 lore raw

PATCH 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

In reply to Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx25-to1.bin sdma-imx25-to2.bin and sdma-imx25-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

---
 arch/arm/plat-mxc/devices/platform-imx-dma.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +0 -2
index c64f015..2091540 100644
@@ -196,8 +196,6 @@ static int __init imxXX_add_imx_dma(void)
 
 #if defined(CONFIG_SOC_IMX51)
 	if (cpu_is_mx51()) {
-		int to_version = mx51_revision() >> 4;
-		imx51_imx_sdma_data.pdata.to_version = to_version;
 		imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51;
 		ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
 	} else
Signature · 1 line
1.7.4.1
reviewer
#6 lore raw

PATCH 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Hi Shawn,

Quoted 8 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. ?That means we have to prepare 3 identical firmwares, sdma-imx25-to1.bin sdma-imx25-to2.bin and sdma-imx25-to3.bin,

I think you want to mean:
sdma-imx51-to1.bin, sdma-imx51-to2.bin, sdma-imx51-to3.bin

Please fix the commit log.

Regards,

Fabio Estevam

#7 lore raw

PATCH 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 7 lines · Fabio Estevam

Hi Shawn,

Quoted 4 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

Quoted 8 lines
Quoted 4 lines

The current code passes TO number to imx-sdma driver to load different firmware for different TO. ?That means we have to prepare 3 identical firmwares, sdma-imx25-to1.bin sdma-imx25-to2.bin and sdma-imx25-to3.bin,

I think you want to mean:
sdma-imx51-to1.bin, sdma-imx51-to2.bin, sdma-imx51-to3.bin

Oops, right.

Quoted 2 lines

Please fix the commit log.

OK.

Signature · 2 lines
Regards,
Shawn
author
#8 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

In reply to Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

---
Changes since v1:
* fix typo in imx51 firmware name caught by Fabio Estevam

 arch/arm/plat-mxc/devices/platform-imx-dma.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +0 -2
index c64f015..2091540 100644
@@ -196,8 +196,6 @@ static int __init imxXX_add_imx_dma(void)
 
 #if defined(CONFIG_SOC_IMX51)
 	if (cpu_is_mx51()) {
-		int to_version = mx51_revision() >> 4;
-		imx51_imx_sdma_data.pdata.to_version = to_version;
 		imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51;
 		ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
 	} else
Signature · 1 line
1.7.4.1
maintainer
#9 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 4 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

Quoted 8 lines

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

I don't agree to this approach. The SDMA firmware has been different on all TO versions of earlier i.MXs. For the linearity of the universe we should keep this. What about providing a link in userspace?

Sascha

Quoted 26 lines

---
Changes since v1:
* fix typo in imx51 firmware name caught by Fabio Estevam

 arch/arm/plat-mxc/devices/platform-imx-dma.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/plat-mxc/devices/platform-imx-dma.c +0 -2
index c64f015..2091540 100644
@@ -196,8 +196,6 @@ static int __init imxXX_add_imx_dma(void)
 
 #if defined(CONFIG_SOC_IMX51)
 	if (cpu_is_mx51()) {
-		int to_version = mx51_revision() >> 4;
-		imx51_imx_sdma_data.pdata.to_version = to_version;
 		imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51;
 		ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
 	} else
Signature · 1 line
1.7.4.1
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 |
#10 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 11 lines · Sascha Hauer
Quoted 10 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

Quoted 7 lines
Quoted 2 lines

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

I don't agree to this approach. The SDMA firmware has been different on all TO versions of earlier i.MXs. For the linearity of the universe we should keep this. What about providing a link in userspace?

The fact is that mx31 and mx35 are the only two SoCs (relatively old ones) that have different SDMA firmwares on different TOs. The relatively new ones, mx25 (TO1, TO1.1), mx50 (TO1, TO1.1), mx51 (TO1, TO2, TO3) and mx53 (TO1, TO2) all have one version SDMA firmware for different TOs. I do not see the mx31/35 case is a linearity of the universe. Do we really want to bother ourselves with userspace link on so many latest SoCs?

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

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 19 lines · Shawn Guo
Quoted 11 lines · Sascha Hauer
Quoted 10 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

Quoted 7 lines
Quoted 2 lines

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

I don't agree to this approach. The SDMA firmware has been different on all TO versions of earlier i.MXs. For the linearity of the universe we should keep this. What about providing a link in userspace?

Quoted 7 lines

The fact is that mx31 and mx35 are the only two SoCs (relatively old ones) that have different SDMA firmwares on different TOs. The relatively new ones, mx25 (TO1, TO1.1), mx50 (TO1, TO1.1), mx51 (TO1, TO2, TO3) and mx53 (TO1, TO2) all have one version SDMA firmware for different TOs. I do not see the mx31/35 case is a linearity of the universe. Do we really want to bother ourselves with userspace link on so many latest SoCs?

Ok, then let's do it differently. Let's go away from "sdma-%s-to%d.bin" in the sdma driver and pass the string from platform data instead. Then we can pass the TO version where it's relevant and skip it where only one firmware exists. Using a sdma-imx51-to1.bin for to2 and to3 is confusing.

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 |
#12 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 28 lines · Sascha Hauer
Quoted 19 lines · Shawn Guo
Quoted 11 lines · Sascha Hauer
Quoted 10 lines · Shawn Guo

Though there are three TOs of imx51 soc, the sdma script never changes since TO1, which means all three TOs of imx51 uses TO1 version of sdma script.

The current code passes TO number to imx-sdma driver to load different firmware for different TO. That means we have to prepare 3 identical firmwares, sdma-imx51-to1.bin sdma-imx51-to2.bin and sdma-imx51-to3.bin, to have the kernel capable of running on all three TOs. This just makes no sense.

Quoted 7 lines
Quoted 2 lines

The patch removes the TO number passing and get the default TO1 version of sdma firmware work for all TOs.

I don't agree to this approach. The SDMA firmware has been different on all TO versions of earlier i.MXs. For the linearity of the universe we should keep this. What about providing a link in userspace?

Quoted 7 lines

The fact is that mx31 and mx35 are the only two SoCs (relatively old ones) that have different SDMA firmwares on different TOs. The relatively new ones, mx25 (TO1, TO1.1), mx50 (TO1, TO1.1), mx51 (TO1, TO2, TO3) and mx53 (TO1, TO2) all have one version SDMA firmware for different TOs. I do not see the mx31/35 case is a linearity of the universe. Do we really want to bother ourselves with userspace link on so many latest SoCs?

Quoted 4 lines

Ok, then let's do it differently. Let's go away from "sdma-%s-to%d.bin" in the sdma driver and pass the string from platform data instead. Then we can pass the TO version where it's relevant and skip it where only one firmware exists. Using a sdma-imx51-to1.bin for to2 and to3

That means the sdma firmware dose not change since to1, confusing? But I'm fine with your idea, so okay, drop the patch from the series, and let's address this issue with another patch.

Other patches look good to be applied?

Quoted 2 lines

is confusing.

Signature · 2 lines
Regards,
Shawn
reviewer
#13 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

On Thu, Jun 16, 2011 at 8:51 AM, Shawn Guo <[email protected]> wrote:
...

Quoted 5 lines

That means the sdma firmware dose not change since to1, confusing? But I'm fine with your idea, so okay, drop the patch from the series, and let's address this issue with another patch.

Other patches look good to be applied?

The other SDMA patches you sent are already in imx-for-2.6.40 now:
http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/imx-for-2.6.40

I think it would be nice if Sascha could reply with a 'applied' email so we know that the patches we sent were accepted.

Regards,

Fabio Estevam

#14 lore raw

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 11 lines · Fabio Estevam

On Thu, Jun 16, 2011 at 8:51 AM, Shawn Guo <[email protected]> wrote:
...

Quoted 5 lines

That means the sdma firmware dose not change since to1, confusing? But I'm fine with your idea, so okay, drop the patch from the series, and let's address this issue with another patch.

Other patches look good to be applied?

The other SDMA patches you sent are already in imx-for-2.6.40 now:
http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/imx-for-2.6.40

Ah, thanks. I have been keeping my eyes on branch imx-for-3.0, so really did not check imx-for-2.6.40. But patch #6 which is the main initiative of the whole patch set is still not applied yet. I suppose it will go through imx-for-3.0.

Speaking of the branch name imx-for-3.0, I'm a little confused here. Shouldn't it be imx-for-3.1, if it targets the next merge window? I'm wrong?

Quoted 3 lines

I think it would be nice if Sascha could reply with a 'applied' email so we know that the patches we sent were accepted.

+1. It would be even better with the branch info.

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

PATCH v2 5/6 ARM: mxc: all three imx51 TOs use TO1 version of sdma script

Quoted 17 lines · Shawn Guo
Quoted 11 lines · Fabio Estevam

On Thu, Jun 16, 2011 at 8:51 AM, Shawn Guo <[email protected]> wrote:
...

Quoted 5 lines

That means the sdma firmware dose not change since to1, confusing? But I'm fine with your idea, so okay, drop the patch from the series, and let's address this issue with another patch.

Other patches look good to be applied?

The other SDMA patches you sent are already in imx-for-2.6.40 now:
http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/imx-for-2.6.40

Ah, thanks. I have been keeping my eyes on branch imx-for-3.0, so really did not check imx-for-2.6.40. But patch #6 which is the main initiative of the whole patch set is still not applied yet. I suppose it will go through imx-for-3.0.

Quoted 8 lines

Speaking of the branch name imx-for-3.0, I'm a little confused here. Shouldn't it be imx-for-3.1, if it targets the next merge window? I'm wrong?

Quoted 3 lines

I think it would be nice if Sascha could reply with a 'applied' email so we know that the patches we sent were accepted.

+1. It would be even better with the branch info.

+1. Wait, I am Sascha. Will do in the future.

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 |
author
#16 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

In reply to Shawn Guo

The patch follows the implementation of gpio-mxc device registration to break the concentrated imx-dma device registration into soc specific setup function. Then we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run.

---
 arch/arm/mach-imx/mm-imx21.c                    |    3 +
 arch/arm/mach-imx/mm-imx25.c                    |   26 +++
 arch/arm/mach-imx/mm-imx27.c                    |    3 +
 arch/arm/mach-imx/mm-imx31.c                    |   24 +++
 arch/arm/mach-imx/mm-imx35.c                    |   44 +++++
 arch/arm/mach-mx5/mm.c                          |   23 +++
 arch/arm/plat-mxc/devices.c                     |   16 ++-
 arch/arm/plat-mxc/devices/platform-imx-dma.c    |  202 ++---------------------
 arch/arm/plat-mxc/include/mach/devices-common.h |    6 +
 9 files changed, 157 insertions(+), 190 deletions(-)
arch/arm/mach-imx/mm-imx21.c +3 -0
index f0fb8bc..8d27f47 100644
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
 #include <mach/irqs.h>
@@ -82,4 +83,6 @@ void __init imx21_soc_init(void)
 	mxc_register_gpio(3, MX21_GPIO4_BASE_ADDR, SZ_4K, MX21_INT_GPIO, 0);
 	mxc_register_gpio(4, MX21_GPIO5_BASE_ADDR, SZ_4K, MX21_INT_GPIO, 0);
 	mxc_register_gpio(5, MX21_GPIO6_BASE_ADDR, SZ_4K, MX21_INT_GPIO, 0);
+
+	imx_add_imx_dma();
 }
arch/arm/mach-imx/mm-imx25.c +26 -0
index 1b6d583..0c54520 100644
@@ -24,6 +24,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/mx25.h>
 #include <mach/iomux-v3.h>
@@ -61,10 +62,35 @@ void __init mx25_init_irq(void)
 	mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR));
 }
 
+static struct sdma_script_start_addrs imx25_sdma_script __initdata = {
+	.ap_2_ap_addr = 729,
+	.uart_2_mcu_addr = 904,
+	.per_2_app_addr = 1255,
+	.mcu_2_app_addr = 834,
+	.uartsh_2_mcu_addr = 1120,
+	.per_2_shp_addr = 1329,
+	.mcu_2_shp_addr = 1048,
+	.ata_2_mcu_addr = 1560,
+	.mcu_2_ata_addr = 1479,
+	.app_2_per_addr = 1189,
+	.app_2_mcu_addr = 770,
+	.shp_2_per_addr = 1407,
+	.shp_2_mcu_addr = 979,
+};
+
+static struct sdma_platform_data imx25_sdma_pdata __initdata = {
+	.sdma_version = 2,
+	.cpu_name = "imx25",
+	.to_version = 1,
+	.script_addrs = &imx25_sdma_script,
+};
+
 void __init imx25_soc_init(void)
 {
 	mxc_register_gpio(0, MX25_GPIO1_BASE_ADDR, SZ_16K, MX25_INT_GPIO1, 0);
 	mxc_register_gpio(1, MX25_GPIO2_BASE_ADDR, SZ_16K, MX25_INT_GPIO2, 0);
 	mxc_register_gpio(2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0);
 	mxc_register_gpio(3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0);
+
+	imx_add_imx_sdma(MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
 }
arch/arm/mach-imx/mm-imx27.c +3 -0
index d3700ce..47a6ada 100644
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
 #include <mach/irqs.h>
@@ -82,4 +83,6 @@ void __init imx27_soc_init(void)
 	mxc_register_gpio(3, MX27_GPIO4_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0);
 	mxc_register_gpio(4, MX27_GPIO5_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0);
 	mxc_register_gpio(5, MX27_GPIO6_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0);
+
+	imx_add_imx_dma();
 }
arch/arm/mach-imx/mm-imx31.c +24 -0
index cb16ac6..bc00a2f 100644
@@ -24,6 +24,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-v3.h>
 #include <mach/irqs.h>
@@ -57,9 +58,32 @@ void __init mx31_init_irq(void)
 	mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
 }
 
+static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = {
+	.per_2_per_addr = 1677,
+};
+
+static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = {
+	.ap_2_ap_addr = 423,
+	.ap_2_bp_addr = 829,
+	.bp_2_ap_addr = 1029,
+};
+
+static struct sdma_platform_data imx31_sdma_pdata __initdata = {
+	.sdma_version = 1,
+	.cpu_name = "imx31",
+};
+
 void __init imx31_soc_init(void)
 {
+	int to_version = mx31_revision() >> 4;
+
 	mxc_register_gpio(0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0);
 	mxc_register_gpio(1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0);
 	mxc_register_gpio(2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0);
+
+	imx31_sdma_pdata.to_version = to_version;
+	imx31_sdma_pdata.script_addrs =
+		(to_version == 1) ?  &imx31_to1_sdma_script :
+				     &imx31_to2_sdma_script;
+	imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
 }
arch/arm/mach-imx/mm-imx35.c +44 -0

59 lines not on this page · raw message

arch/arm/mach-mx5/mm.c +23 -0
index 800bb8b2..5af490a 100644
@@ -18,6 +18,7 @@
 
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/iomux-v3.h>
 
 /*
@@ -100,12 +101,34 @@ void __init mx53_init_irq(void)
 	tzic_init_irq(tzic_virt);
 }
 
+static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
+	.ap_2_ap_addr = 642,
+	.uart_2_mcu_addr = 817,
+	.mcu_2_app_addr = 747,
+	.mcu_2_shp_addr = 961,
+	.ata_2_mcu_addr = 1473,
+	.mcu_2_ata_addr = 1392,
+	.app_2_per_addr = 1033,
+	.app_2_mcu_addr = 683,
+	.shp_2_per_addr = 1251,
+	.shp_2_mcu_addr = 892,
+};
+
+static struct sdma_platform_data imx51_sdma_pdata __initdata = {
+	.sdma_version = 2,
+	.cpu_name = "imx51",
+	.to_version = 1,
+	.script_addrs = &imx51_sdma_script,
+};
+
 void __init imx51_soc_init(void)
 {
 	mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
 	mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
 	mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
 	mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
+
+	imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
 }
 
 void __init imx53_soc_init(void)
arch/arm/plat-mxc/devices.c +15 -1
index fb166b2..0d6ed31 100644
@@ -95,8 +95,22 @@ struct device mxc_aips_bus = {
 	.parent		= &platform_bus,
 };
 
+struct device mxc_ahb_bus = {
+	.init_name	= "mxc_ahb",
+	.parent		= &platform_bus,
+};
+
 static int __init mxc_device_init(void)
 {
-	return device_register(&mxc_aips_bus);
+	int ret;
+
+	ret = device_register(&mxc_aips_bus);
+	if (IS_ERR_VALUE(ret))
+		goto done;
+
+	ret = device_register(&mxc_ahb_bus);
+
+done:
+	return ret;
 }
 core_initcall(mxc_device_init);
arch/arm/plat-mxc/devices/platform-imx-dma.c +13 -189

218 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/devices-common.h +6 -0
index 03f6266..bf93820 100644
@@ -9,8 +9,10 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <mach/sdma.h>
 
 extern struct device mxc_aips_bus;
+extern struct device mxc_ahb_bus;
 
 struct platform_device *imx_add_platform_device_dmamask(
 		const char *name, int id,
@@ -293,3 +295,7 @@ struct imx_spi_imx_data {
 struct platform_device *__init imx_add_spi_imx(
 		const struct imx_spi_imx_data *data,
 		const struct spi_imx_master *pdata);
+
+struct platform_device *imx_add_imx_dma(void);
+struct platform_device *imx_add_imx_sdma(
+	resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
Signature · 1 line
1.7.4.1
#17 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Hi Sascha,

Any comment on this one?

Regards,
Shawn

Quoted 20 lines · Shawn Guo

The patch follows the implementation of gpio-mxc device registration to break the concentrated imx-dma device registration into soc specific setup function. Then we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run.

---
 arch/arm/mach-imx/mm-imx21.c                    |    3 +
 arch/arm/mach-imx/mm-imx25.c                    |   26 +++
 arch/arm/mach-imx/mm-imx27.c                    |    3 +
 arch/arm/mach-imx/mm-imx31.c                    |   24 +++
 arch/arm/mach-imx/mm-imx35.c                    |   44 +++++
 arch/arm/mach-mx5/mm.c                          |   23 +++
 arch/arm/plat-mxc/devices.c                     |   16 ++-
 arch/arm/plat-mxc/devices/platform-imx-dma.c    |  202 ++---------------------
 arch/arm/plat-mxc/include/mach/devices-common.h |    6 +
 9 files changed, 157 insertions(+), 190 deletions(-)
#18 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Quoted 4 lines · Shawn Guo

Hi Sascha,

Any comment on this one?

One more ping: any comment?

The patch has been out there for a while with no comments. My understanding is you will need to either give comments or apply the patch, no?

Quoted 31 lines

Regards,
Shawn

Quoted 8 lines · Shawn Guo

The patch follows the implementation of gpio-mxc device registration to break the concentrated imx-dma device registration into soc specific setup function. Then we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run.

Quoted 12 lines
---
 arch/arm/mach-imx/mm-imx21.c                    |    3 +
 arch/arm/mach-imx/mm-imx25.c                    |   26 +++
 arch/arm/mach-imx/mm-imx27.c                    |    3 +
 arch/arm/mach-imx/mm-imx31.c                    |   24 +++
 arch/arm/mach-imx/mm-imx35.c                    |   44 +++++
 arch/arm/mach-mx5/mm.c                          |   23 +++
 arch/arm/plat-mxc/devices.c                     |   16 ++-
 arch/arm/plat-mxc/devices/platform-imx-dma.c    |  202 ++---------------------
 arch/arm/plat-mxc/include/mach/devices-common.h |    6 +
 9 files changed, 157 insertions(+), 190 deletions(-)

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

Signature · 2 lines
Regards,
Shawn
#19 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Quoted 4 lines

The patch has been out there for a while with no comments. My understanding is you will need to either give comments or apply the patch, no?

Yes, but there is no timeframe guaranteed. We try our best to respond as fast as possible, but we (like most others) have a couple of things on our todo-list.

Regards,

Wolfram

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110621/078457e4/attachment.sig>
#20 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Quoted 9 lines · Wolfram Sang
Quoted 4 lines

The patch has been out there for a while with no comments. My understanding is you will need to either give comments or apply the patch, no?

Yes, but there is no timeframe guaranteed. We try our best to respond as fast as possible, but we (like most others) have a couple of things on our todo-list.

Totally understandable. I could have hold this second ping for another few days. But I saw Sascha picked up Fabio's mx53 SDMA patch which grows the stuff I'm trying to clean up. It actually is Fabio's patch reminding me to send the patch clean this stuff up.

So in this particular case, it's not about time frame but picking up the right patch in the right order.

Signature · 2 lines
Regards,
Shawn
#21 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Quoted 2 lines

So in this particular case, it's not about time frame but picking up the right patch in the right order.

Ah, okay. That's a perfectly valid reason, of course. Would be nice to state the reason in the "ping"-mail next time :)

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110622/023d23e9/attachment-0001.sig>
maintainer
#22 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

In reply to Shawn Guo
Quoted 4 lines · Shawn Guo

Hi Sascha,

Any comment on this one?

Please respin this series on the for-next branch. Fabio has added i.MX53 support in the meantime and this does not apply anymore.

Sascha

Quoted 26 lines

Regards,
Shawn

Quoted 20 lines · Shawn Guo

The patch follows the implementation of gpio-mxc device registration to break the concentrated imx-dma device registration into soc specific setup function. Then we can avoid the churn of "#ifdef" and the cpu_is_mx checking on such a long list, which makes no sense, considering more soc supports need to be added and we need to support single image for multiple socs in the long run.

---
 arch/arm/mach-imx/mm-imx21.c                    |    3 +
 arch/arm/mach-imx/mm-imx25.c                    |   26 +++
 arch/arm/mach-imx/mm-imx27.c                    |    3 +
 arch/arm/mach-imx/mm-imx31.c                    |   24 +++
 arch/arm/mach-imx/mm-imx35.c                    |   44 +++++
 arch/arm/mach-mx5/mm.c                          |   23 +++
 arch/arm/plat-mxc/devices.c                     |   16 ++-
 arch/arm/plat-mxc/devices/platform-imx-dma.c    |  202 ++---------------------
 arch/arm/plat-mxc/include/mach/devices-common.h |    6 +
 9 files changed, 157 insertions(+), 190 deletions(-)
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 |
#23 lore raw

PATCH 6/6 ARM: mxc: clean up imx-dma device registration

Quoted 9 lines · Sascha Hauer
Quoted 4 lines · Shawn Guo

Hi Sascha,

Any comment on this one?

Please respin this series on the for-next branch. Fabio has added i.MX53 support in the meantime and this does not apply anymore.

This is exactly the thing I feel strange about. I sent the patch trying to stop people adding more churn there. However, you applied the patch adding more churn yesterday, and are asking me to rebase this cleanup patch set today. IMO, the cleanup patch should be applied first, and the i.MX53 patch should be asked to respin.

But no problem, I will do.

Signature · 2 lines
Regards,
Shawn