Skip to contentSkip to conversation

MXS getting AUART to work with DT.

DISCUSSION Subodh Nijsure 4 participants 12 messages Jun 13, 2012 – Jun 15, 2012

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

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

auart0_pins_a: auart0 at 0 {
         reg = <0>;
         fsl,pinmux-ids = <0x3000 0x3010 0x3020 0x3030>;
         fsl,drive-strength = <0>;
         fsl,voltage = <1>;
         fsl,pull-up = <0>;
};
auart1_pins_a: auart1 at 0 {
         reg = <0>;
         fsl,pinmux-ids = <0x3040 0x3050>;
         fsl,drive-strength = <0>;
         fsl,voltage = <1>;
         fsl,pull-up = <0>;
};
auart0: serial at 8006a000 {
          pinctrl-names = "default";
          pinctrl-0 = <&auart0_pins_a>;
          status = "okay";
};
auart1: serial at 8006c000 {
           pinctrl-names = "default";
           pinctrl-0 = <&auart1_pins_a>;
           status = "okay";

};

-Subodh

reviewer
#1 lore raw

Hi Subodh,

Quoted 8 lines · Subodh Nijsure

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made ?additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

I just enabled CONFIG_SERIAL_MXS_AUART and booted my mx28evk (non-DT case) that registers
auart0 and auart2, but I don't see any ttyAPPx node.

Is there anything I am missing?

I would like to get ttyAPP0/2 working first on non-DT case.

Thanks,

Fabio Estevam

#2 lore raw

Dear Fabio Estevam,

Quoted 3 lines

Hi Subodh,

On Tue, Jun 12, 2012 at 10:42 PM, Subodh Nijsure <[email protected]>

Quoted 9 lines · wrote:
Quoted 8 lines

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made
additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

Quoted 7 lines

I just enabled CONFIG_SERIAL_MXS_AUART and booted my mx28evk (non-DT case) that registers
auart0 and auart2, but I don't see any ttyAPPx node.

Is there anything I am missing?

I would like to get ttyAPP0/2 working first on non-DT case.

I think the kernel for non-DT case is already FUBAR ... just do a simple DT conversion :-(

Quoted 3 lines

Thanks,

Fabio Estevam

Best regards,
your utmost DT supporter and friend
Marek Vasut

reviewer
#3 lore raw
Quoted 2 lines · Marek Vasut

I think the kernel for non-DT case is already FUBAR ... just do a simple DT conversion :-(

So does it mean mxs-auart has never been used?

reviewer
#4 lore raw
Quoted 6 lines · Fabio Estevam
Quoted 2 lines · Marek Vasut

I think the kernel for non-DT case is already FUBAR ... just do a simple DT conversion :-(

So does it mean mxs-auart has never been used?

Ok, just tested a 3.4.2 (non-DT kernel) and I see:

[    0.570000] mxs-auart.0: ttyAPP0 at MMIO 0x8006a000 (irq = 112) is
a mxs-auart.0
[    0.580000] mxs-auart mxs-auart.0: Found APPUART 3.1.0
[    0.590000] mxs-auart.3: ttyAPP3 at MMIO 0x80070000 (irq = 115) is
a mxs-auart.3
[    0.600000] mxs-auart mxs-auart.3: Found APPUART 3.1.0

,so it means that something broke mxs-auart on 3.5-rc.

Will look more on this tomorrow.

#5 lore raw

Dear Fabio Estevam,

Quoted 9 lines · Fabio Estevam
Quoted 5 lines · Marek Vasut
Quoted 2 lines

I think the kernel for non-DT case is already FUBAR ... just do a simple DT conversion :-(

So does it mean mxs-auart has never been used?

Ok, just tested a 3.4.2 (non-DT kernel) and I see:

Quoted 8 lines
[    0.570000] mxs-auart.0: ttyAPP0 at MMIO 0x8006a000 (irq = 112) is
a mxs-auart.0
[    0.580000] mxs-auart mxs-auart.0: Found APPUART 3.1.0
[    0.590000] mxs-auart.3: ttyAPP3 at MMIO 0x80070000 (irq = 115) is
a mxs-auart.3
[    0.600000] mxs-auart mxs-auart.3: Found APPUART 3.1.0

,so it means that something broke mxs-auart on 3.5-rc.

I tested it on 3.4-rc6, it worked back there with non-DT kernel.

Quoted 1 line

Will look more on this tomorrow.

Best regards,
Marek Vasut

#6 lore raw
In reply to Subodh Nijsure

Dear Subodh Nijsure,

Quoted 8 lines

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

Last time I checked, it wasn't that easy to get AUART flipped over to DT. Did someone do that already?

Quoted 24 lines
auart0_pins_a: auart0 at 0 {
         reg = <0>;
         fsl,pinmux-ids = <0x3000 0x3010 0x3020 0x3030>;
         fsl,drive-strength = <0>;
         fsl,voltage = <1>;
         fsl,pull-up = <0>;
};
auart1_pins_a: auart1 at 0 {
         reg = <0>;
         fsl,pinmux-ids = <0x3040 0x3050>;
         fsl,drive-strength = <0>;
         fsl,voltage = <1>;
         fsl,pull-up = <0>;
};
auart0: serial at 8006a000 {
          pinctrl-names = "default";
          pinctrl-0 = <&auart0_pins_a>;
          status = "okay";
};
auart1: serial at 8006c000 {
           pinctrl-names = "default";
           pinctrl-0 = <&auart1_pins_a>;
           status = "okay";
Quoted 3 lines

};

-Subodh

Best regards,
Marek Vasut

reviewer
#7 lore raw
In reply to Subodh Nijsure
Quoted 8 lines · Subodh Nijsure

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made ?additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

Would something like the patch below be needed?

---
 arch/arm/boot/dts/imx28.dtsi   |    5 +++++
 drivers/tty/serial/mxs-auart.c |    9 +++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28.dtsi +5 -0
index 4634cb8..d524377 100644
@@ -404,30 +404,35 @@
 			};
 
 			auart0: serial at 8006a000 {
+				compatible = "fsl,mxs-auart";
 				reg = <0x8006a000 0x2000>;
 				interrupts = <112 70 71>;
 				status = "disabled";
 			};
 
 			auart1: serial at 8006c000 {
+				compatible = "fsl,mxs-auart";
 				reg = <0x8006c000 0x2000>;
 				interrupts = <113 72 73>;
 				status = "disabled";
 			};
 
 			auart2: serial at 8006e000 {
+				compatible = "fsl,mxs-auart";
 				reg = <0x8006e000 0x2000>;
 				interrupts = <114 74 75>;
 				status = "disabled";
 			};
 
 			auart3: serial at 80070000 {
+				compatible = "fsl,mxs-auart";
 				reg = <0x80070000 0x2000>;
 				interrupts = <115 76 77>;
 				status = "disabled";
 			};
 
 			auart4: serial at 80072000 {
+				compatible = "fsl,mxs-auart";
 				reg = <0x80072000 0x2000>;
 				interrupts = <116 78 79>;
 				status = "disabled";
drivers/tty/serial/mxs-auart.c +2 -0
index ec56d83..6540f28 100644
@@ -33,6 +33,8 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/cacheflush.h>
 
@@ -769,12 +771,19 @@ static int __devexit mxs_auart_remove(struct

platform_device *pdev)
return 0;
}

+static struct of_device_id mxs_auart_dt_ids[] = {
+ {.compatible = "fsl,mxs-auart", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_auart_of_match); +
static struct platform_driver mxs_auart_driver = {
.probe = mxs_auart_probe,
.remove = __devexit_p(mxs_auart_remove), .driver = {
.name = "mxs-auart",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(mxs_auart_dt_ids),
},
};

Signature · 1 line
1.7.1
#8 lore raw
Quoted 80 lines · Fabio Estevam
Quoted 8 lines · Subodh Nijsure

Hi,

I am testing my mx28 hardware with arm-soc/for-next branch. I have made
additions shown below to my dt file.

What I see is only ttyAPP0 device gets created but not the ttyAPP1, do folks who know DT much better than I, see any issues with this DT definition below?

Would something like the patch below be needed?

---
  arch/arm/boot/dts/imx28.dtsi   |    5 +++++
  drivers/tty/serial/mxs-auart.c |    9 +++++++++
  2 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28.dtsi +5 -0
index 4634cb8..d524377 100644
@@ -404,30 +404,35 @@
  			};
 
  			auart0: serial at 8006a000 {
+				compatible = "fsl,mxs-auart";
  				reg =<0x8006a000 0x2000>;
  				interrupts =<112 70 71>;
  				status = "disabled";
  			};
 
  			auart1: serial at 8006c000 {
+				compatible = "fsl,mxs-auart";
  				reg =<0x8006c000 0x2000>;
  				interrupts =<113 72 73>;
  				status = "disabled";
  			};
 
  			auart2: serial at 8006e000 {
+				compatible = "fsl,mxs-auart";
  				reg =<0x8006e000 0x2000>;
  				interrupts =<114 74 75>;
  				status = "disabled";
  			};
 
  			auart3: serial at 80070000 {
+				compatible = "fsl,mxs-auart";
  				reg =<0x80070000 0x2000>;
  				interrupts =<115 76 77>;
  				status = "disabled";
  			};
 
  			auart4: serial at 80072000 {
+				compatible = "fsl,mxs-auart";
  				reg =<0x80072000 0x2000>;
  				interrupts =<116 78 79>;
  				status = "disabled";
drivers/tty/serial/mxs-auart.c +7 -0
index ec56d83..6540f28 100644
@@ -33,6 +33,8 @@
  #include<linux/delay.h>
  #include<linux/io.h>
  #include<linux/pinctrl/consumer.h>
+#include<linux/of.h>
+#include<linux/of_address.h>
 
  #include<asm/cacheflush.h>
 
@@ -769,12 +771,19 @@ static int __devexit mxs_auart_remove(struct
 platform_device *pdev)
  	return 0;
  }
 
+static struct of_device_id mxs_auart_dt_ids[] = {
+	{.compatible = "fsl,mxs-auart", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_auart_of_match);

drivers/tty/serial/mxs-auart.c static int __devexit mxs_auart_remove(struct · line 789

Quoted 10 lines
drivers/tty/serial/mxs-auart.c +2 -0
+
  static struct platform_driver mxs_auart_driver = {
  	.probe = mxs_auart_probe,
  	.remove = __devexit_p(mxs_auart_remove),
  	.driver = {
  		.name = "mxs-auart",
  		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(mxs_auart_dt_ids),
  	},
  };

With this change you will only see AUART0 being created all subsequent attempts fail. I think we need to have dt specific probe, my colleague Matt Burtch has implemented that dt specific probe for AUART will request him to send his diff tomorrow AM.

I think something is broken in 3.5 as far as I can tell AUART goes it had worked for me in 3.4, I am novice at device-tree and was not sure if its because of DT or something else.

-Subodh

reviewer
#9 lore raw
Quoted 8 lines · Subodh Nijsure

With this change you will only see AUART0 being created all subsequent attempts fail. ?I think we need to have dt specific probe, my colleague Matt Burtch has implemented that dt specific probe for AUART will request him to send his diff tomorrow AM.

I think something is broken in 3.5 as far as I can tell AUART goes it had worked for me in 3.4, I am novice at device-tree and was not sure if its because of DT or something else.

Ok, just tested linux-next and I see that mxs-auart probes correctly for the non-dt kernel.

We need to fix mxs-auart for dt now.

Regards,

Fabio Estevam

#10 lore raw

Here is the patch I put together to get the AUART recognized with the dt. I'm pretty new to dt development, so this was a quick first pass. I'm sure there are more proper ways to get the device id and pass literals between the dt and probe function...but this works for now.

Regards,
-Matt Burtch
________________________________________
From: Fabio Estevam [festevam at gmail.com]
Sent: Wednesday, June 13, 2012 9:54 PM
To: Subodh Nijsure
Cc: linux-arm-kernel at lists.infradead.org; Marek Va?ut; Shawn Guo; Matt Burtch
Subject: Re: MXS getting AUART to work with DT.

Quoted 8 lines · Subodh Nijsure

With this change you will only see AUART0 being created all subsequent attempts fail. I think we need to have dt specific probe, my colleague Matt Burtch has implemented that dt specific probe for AUART will request him to send his diff tomorrow AM.

I think something is broken in 3.5 as far as I can tell AUART goes it had worked for me in 3.4, I am novice at device-tree and was not sure if its because of DT or something else.

Ok, just tested linux-next and I see that mxs-auart probes correctly for the non-dt kernel.

We need to fix mxs-auart for dt now.

Regards,

Fabio Estevam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mxs-auart.patch
Type: text/x-patch
Size: 3155 bytes
Desc: mxs-auart.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120614/9fae73f8/attachment-0001.bin>

reviewer
#11 lore raw

Hi Matt,

Quoted 1 line · Matt Burtch

Here is the patch I put together to get the AUART recognized with the dt. ?I'm pretty new to dt development, so this was a quick first pass. I'm sure there are more proper ways to get the device id and pass literals between the dt and probe function...but this works for now.

Ok, I managed to fix it properly now.

Will submit the patches tomorrow.

Regards,

Fabio Estevam