Skip to contentSkip to conversation

Mx35pdk: enable debug board support

PATCH Superseded jgq516 at gmail.com 2 participants 10 messages Oct 15, 2010 – Oct 20, 2010

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

From: Xiao Jiang <[email protected]>

Add debug board support, then kernel can boot from lan9217 ethernet.

---
 arch/arm/mach-mx3/mach-mx35_3ds.c          |    9 +++++++++
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/mach-mx35_3ds.c +9 -0
index 1c30d72..78e0657 100644
@@ -34,11 +34,16 @@
 
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
+#include <mach/iomux-mx3.h>
 #include <mach/iomux-mx35.h>
+#include <mach/3ds_debugboard.h>
 
 #include "devices-imx35.h"
 #include "devices.h"
 
+#define EXPIO_PARENT_INT	IOMUX_TO_IRQ(MX35_PIN_GPIO1_1)
+
 static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
@@ -95,6 +100,10 @@ static void __init mxc_board_init(void)
 	imx35_add_imx_uart0(&uart_pdata);
 
 	mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+
+	if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
+		pr_warn("Init of the debugboard failed, all "
+			"devices on the board are unusable.\n");
 }
 
 static void __init mx35pdk_timer_init(void)
arch/arm/plat-mxc/include/mach/iomux-mx3.h +4 -0
index cbaed29..c686d2a 100644
@@ -170,6 +170,10 @@ int mxc_iomux_mode(unsigned int pin_mode);
  * value is constructed based on the rules described above.
  */
 
+enum iomux_mx35_pins {
+	MX35_PIN_GPIO1_1	= IOMUX_PIN(1,   338),
+};
+
 enum iomux_pins {
 	MX31_PIN_TTM_PAD	= IOMUX_PIN(0xff,   0),
 	MX31_PIN_CSPI3_SPI_RDY	= IOMUX_PIN(0xff,   1),
Signature · 1 line
1.6.3.3
author
#1 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Hi Uwe & Fabio,

2010/10/15 <[email protected]>

Quoted 60 lines

From: Xiao Jiang <[email protected]>

Add debug board support, then kernel can boot from lan9217 ethernet.

---
 arch/arm/mach-mx3/mach-mx35_3ds.c          |    9 +++++++++
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/mach-mx35_3ds.c +9 -0
index 1c30d72..78e0657 100644
@@ -34,11 +34,16 @@
 
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
+#include <mach/iomux-mx3.h>
 #include <mach/iomux-mx35.h>
+#include <mach/3ds_debugboard.h>
 
 #include "devices-imx35.h"
 #include "devices.h"
 
+#define EXPIO_PARENT_INT       IOMUX_TO_IRQ(MX35_PIN_GPIO1_1)
+
 static const struct imxuart_platform_data uart_pdata __initconst = {
       .flags = IMXUART_HAVE_RTSCTS,
 };
@@ -95,6 +100,10 @@ static void __init mxc_board_init(void)
       imx35_add_imx_uart0(&uart_pdata);
 
       mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+
+       if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
+               pr_warn("Init of the debugboard failed, all "
+                       "devices on the board are unusable.\n");
 }
 
 static void __init mx35pdk_timer_init(void)
arch/arm/plat-mxc/include/mach/iomux-mx3.h +4 -1
index cbaed29..c686d2a 100644
@@ -170,6 +170,10 @@ int mxc_iomux_mode(unsigned int pin_mode);
 * value is constructed based on the rules described above.
 */
 
+enum iomux_mx35_pins {
+       MX35_PIN_GPIO1_1        = IOMUX_PIN(1,   338),
+};
+
 enum iomux_pins {
       MX31_PIN_TTM_PAD        = IOMUX_PIN(0xff,   0),
       MX31_PIN_CSPI3_SPI_RDY  = IOMUX_PIN(0xff,   1),
--
Quoted 3 lines

1.6.3.3

Any comments? And I can't the sdma driver in arch/arm/plat-mxc/ which is used by lots of i.mx chips, is somebody planing to do it or it will going to mainline soon ?

Thanks,
Xiao Jiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101018/5ed9cedf/attachment-0001.html>

reviewer
#2 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Hi Xiao,

2010/10/18 xiao jiang <[email protected]>:

Quoted 21 lines

Hi Uwe & Fabio,

2010/10/15 <[email protected]>

Quoted 18 lines

From: Xiao Jiang <[email protected]>

Add debug board support, then kernel can boot from lan9217 ethernet.

---
?arch/arm/mach-mx3/mach-mx35_3ds.c ? ? ? ? ?| ? ?9 +++++++++ ?arch/arm/plat-mxc/include/mach/iomux-mx3.h | ? ?4 ++++ ?2 files changed, 13 insertions(+), 0 deletions(-)

arch/arm/mach-mx3/mach-mx35_3ds.c +0 -0
index 1c30d72..78e0657 100644
@@ -34,11 +34,16 @@
 
Quoted 4 lines

arch/arm/mach-mx3/mach-mx35_3ds.c line 38

Quoted 4 lines

?#include <mach/hardware.h>
?#include <mach/common.h>

arch/arm/mach-mx3/mach-mx35_3ds.c +2 -0
+#include <mach/irqs.h>
+#include <mach/iomux-mx3.h>

You don't need to add this.

Quoted 7 lines
Quoted 7 lines

?#include <mach/iomux-mx35.h>
+#include <mach/3ds_debugboard.h>

?#include "devices-imx35.h"
?#include "devices.h"

+#define EXPIO_PARENT_INT ? ? ? IOMUX_TO_IRQ(MX35_PIN_GPIO1_1)

Why don't you use MX35_PAD_GPIO1_1__GPIO1_1 instead which is already defined at:
arch/arm/plat-mxc/include/mach/iomux-mx35.h ?

Also, look at how MX31-3stack implemented the debug board support and pass MXC_DEBUG_BOARD in the Kconfig.

Quoted 4 lines

Any comments? And I can't the sdma driver in arch/arm/plat-mxc/ which is used by lots of i.mx chips, is somebody planing to do it or it will going to mainline soon ?

Sascha submitted initial support patches for i.MX SDMA.

Regards,

Fabio Estevam

author
#3 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Hi Fabio,

2010/10/19 Fabio Estevam <[email protected]>

Quoted 37 lines

Hi Xiao,

2010/10/18 xiao jiang <[email protected]>:

Quoted 21 lines

Hi Uwe & Fabio,

2010/10/15 <[email protected]>

Quoted 18 lines

From: Xiao Jiang <[email protected]>

Add debug board support, then kernel can boot from lan9217 ethernet.

---
 arch/arm/mach-mx3/mach-mx35_3ds.c          |    9 +++++++++
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/mach-mx35_3ds.c +0 -0
index 1c30d72..78e0657 100644
@@ -34,11 +34,16 @@
 
Quoted 4 lines

arch/arm/mach-mx3/mach-mx35_3ds.c line 38

Quoted 4 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +2 -0
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
+#include <mach/iomux-mx3.h>

You don't need to add this.

Quoted 6 lines
Quoted 6 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +1 -0
 #include <mach/iomux-mx35.h>
+#include <mach/3ds_debugboard.h>
 
 #include "devices-imx35.h"
 #include "devices.h"
 
Quoted 8 lines
Quoted 1 line

arch/arm/mach-mx3/mach-mx35_3ds.c line 45

Quoted 1 line
arch/arm/mach-mx3/mach-mx35_3ds.c +1 -0
+#define EXPIO_PARENT_INT       IOMUX_TO_IRQ(MX35_PIN_GPIO1_1)

Why don't you use MX35_PAD_GPIO1_1__GPIO1_1 instead which is already defined at:
arch/arm/plat-mxc/include/mach/iomux-mx35.h ?

I tried to use MX35_PAD_GPIO1_1__GPIO1_1, but there isn't function to

transform to irq num, so I added
the pin definition in iomux-mx3.h. Is there any function can transform the PAD to irq num?

Only board-mx51_3ds.c & mach-mx31_3ds.c which called mxc_expio_init function, and I followed the rule of mach-mx31_3ds.c. Is it ok to change style like mx51_3ds as follows?
#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6)

Also, look at how MX31-3stack implemented the debug board support and

Quoted 5 lines

pass MXC_DEBUG_BOARD in the Kconfig.

Got it, will add it

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

Any comments? And I can't the sdma driver in arch/arm/plat-mxc/ which is used by lots of i.mx chips, is somebody planing to do it or it will going to mainline soon ?

Sascha submitted initial support patches for i.MX SDMA.

That is great!

Thanks
Xiao Jiang

Quoted 4 lines

Regards,

Fabio Estevam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101019/4503b7a5/attachment-0001.html>

reviewer
#4 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Xiao,
...

Quoted 4 lines

I tried to use? MX35_PAD_GPIO1_1__GPIO1_1, but there isn't function to transform to irq num, so I added
the pin definition in iomux-mx3.h. Is there any function can transform the PAD to irq num?

You can do the following:

#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)

and also add MX35_PAD_GPIO1_1__GPIO1_1 into the mx35pdk_pads struct.

Regards,

Fabio Estevam

author
#5 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

2010/10/19 Fabio Estevam <[email protected]>

Quoted 9 lines

Xiao,
...

Quoted 3 lines

I tried to use MX35_PAD_GPIO1_1__GPIO1_1, but there isn't function to transform to irq num, so I added
the pin definition in iomux-mx3.h. Is there any function can transform

the

Quoted 1 line

PAD to irq num?

Quoted 7 lines

You can do the following:

#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)

and also add MX35_PAD_GPIO1_1__GPIO1_1 into the mx35pdk_pads struct.

I don't think so, since **_PIN_** is expected for IOMUX_TO_IRQ, not

**_PAD_**, and I think kernel can't pass compile with "IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)"

Thanks,
Xiao Jiang

Quoted 4 lines

Regards,

Fabio Estevam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101019/f8e89f05/attachment-0001.html>

reviewer
#6 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Quoted 2 lines · xiao jiang

...

Quoted 4 lines
Quoted 1 line

I don't think so, since **_PIN_** is expected for IOMUX_TO_IRQ, not **_PAD_**, and I think kernel can't pass compile with "IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)"

Have you tried the same method as in MX51_3ds?

#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTx + y)

Regards,

Fabio Estevam

reviewer
#7 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Xiao,

Quoted 9 lines · Fabio Estevam
Quoted 2 lines · xiao jiang

...

Quoted 4 lines
Quoted 1 line

I don't think so, since **_PIN_** is expected for IOMUX_TO_IRQ, not **_PAD_**, and I think kernel can't pass compile with "IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)"

Quoted 8 lines

Have you tried the same method as in MX51_3ds?

#define EXPIO_PARENT_INT ? ?(MXC_INTERNAL_IRQS + GPIO_PORTx + y)

Regards,

Fabio Estevam

Please try the the patch below. Worked fine for me.

arch/arm/mach-mx3/Kconfig +1 -0
index 096fd33..9658e2d 100644
@@ -143,6 +143,7 @@ config MACH_ARMADILLO5X0
 config MACH_MX35_3DS
 	bool "Support MX35PDK platform"
 	select ARCH_MX35
+	select MXC_DEBUG_BOARD
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_NAND
 	default n
(quoted diff) +0 -0

b/arch/arm/mach-mx3/mach-mx35_3ds.c
index 91bb065..b7e6b9c 100644

arch/arm/mach-mx3/mach-mx35_3ds.c +8 -0
@@ -39,10 +39,15 @@
 #include <mach/common.h>
 #include <mach/iomux-mx35.h>
 #include <mach/mxc_ehci.h>
+#include <mach/3ds_debugboard.h>
+#include <mach/irqs.h>
 
 #include "devices-imx35.h"
 #include "devices.h"
 
+#define EXPIO_PARENT_INT       (MXC_INTERNAL_IRQS + GPIO_PORTA + 1)
+
 static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
@@ -140,6 +145,10 @@ static void __init mxc_board_init(void)
 	mxc_register_device(&mxc_usbh1, &usb_host_pdata);
 
 	imx35_add_mxc_nand(&mx35pdk_nand_board_info);
+
+	if (!mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
+		printk(KERN_WARNING "Init of the debugboard failed, all "
+				    "devices on the board are unusable.\n");
 }
 
 static void __init mx35pdk_timer_init(void)
author
#8 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Hi Fabio,

2010/10/20 Fabio Estevam <[email protected]>

Quoted 14 lines

Xiao,

Quoted 11 lines · Fabio Estevam
Quoted 2 lines · xiao jiang

...

Quoted 4 lines
Quoted 1 line

I don't think so, since **_PIN_** is expected for IOMUX_TO_IRQ, not **_PAD_**, and I think kernel can't pass compile with "IOMUX_TO_IRQ(MX35_PAD_GPIO1_1__GPIO1_1)"

Have you tried the same method as in MX51_3ds?

Quoted 9 lines
Quoted 6 lines

#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTx + y)

Regards,

Fabio Estevam

Please try the the patch below. Worked fine for me.

The patch is ok for me too, and the definition of EXPIO_PARENT_INT is similar like mx51_3ds board
as I had said before.
But since mxc_expio_init() should be return *0* if the debug board is detected, We should use
mxc_expio_init(**_BASE_ADDR, EXPIO_PARENT_INT) other than !mxc_expio_init(**_BASE_ADDR, EXPIO_PARENT_INT), right? The same issue also existed in mach-mx31_3ds.c.

Thanks,
Xiao Jiang

arch/arm/mach-mx3/Kconfig +0 -0
Quoted 42 lines

index 096fd33..9658e2d 100644

arch/arm/mach-mx3/Kconfig +1 -0
@@ -143,6 +143,7 @@ config MACH_ARMADILLO5X0
 config MACH_MX35_3DS
       bool "Support MX35PDK platform"
       select ARCH_MX35
+       select MXC_DEBUG_BOARD
       select IMX_HAVE_PLATFORM_IMX_UART
       select IMX_HAVE_PLATFORM_MXC_NAND
       default n
arch/arm/mach-mx3/mach-mx35_3ds.c +8 -0
index 91bb065..b7e6b9c 100644
@@ -39,10 +39,15 @@
 #include <mach/common.h>
 #include <mach/iomux-mx35.h>
 #include <mach/mxc_ehci.h>
+#include <mach/3ds_debugboard.h>
+#include <mach/irqs.h>
 
 #include "devices-imx35.h"
 #include "devices.h"
 
+#define EXPIO_PARENT_INT       (MXC_INTERNAL_IRQS + GPIO_PORTA + 1)
+
 static const struct imxuart_platform_data uart_pdata __initconst = {
       .flags = IMXUART_HAVE_RTSCTS,
 };
@@ -140,6 +145,10 @@ static void __init mxc_board_init(void)
       mxc_register_device(&mxc_usbh1, &usb_host_pdata);
 
       imx35_add_mxc_nand(&mx35pdk_nand_board_info);
+
+       if (!mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
+               printk(KERN_WARNING "Init of the debugboard failed, all "
+                                   "devices on the board are
 unusable.\n");
 }
 
Quoted 2 lines

static void __init mx35pdk_timer_init(void)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101020/52825fdd/attachment-0001.html>

reviewer
#9 lore raw

PATCH 1/1 Mx35pdk: enable debug board support

Xiao,

Quoted 9 lines · xiao jiang

The patch is ok for me too,? and? the definition of EXPIO_PARENT_INT is similar like mx51_3ds board
as I had said before.
But since mxc_expio_init() should be return 0 if the debug board is detected, We should use
mxc_expio_init(**_BASE_ADDR, EXPIO_PARENT_INT) other than !mxc_expio_init(**_BASE_ADDR, EXPIO_PARENT_INT), right?? The same issue also existed in mach-mx31_3ds.c.

mxc_expio_init returns 0 if the debug board is detected. !mxc_expio_init returns 1 and print the error message.

So this is correct. I also get a message during the kernel boot saying that the debug board was succesfully detected.

If you want, please resubmit a v2 of your original patch and also add my:

Regards,

Fabio Esevam