Skip to contentSkip to conversation

uart issues on coldfire platform

DISCUSSION Lanttor 3 participants 5 messages Jul 1, 2009 – Jul 2, 2009

lore
Share & tools
lore

Lanttor

author
#0 lore raw

Hi,

I find one issue of UART on my coldfire platforms (mcf54451evb board). I use the linux-2.6.29, and use drivers/serial/mcf.c and drivers/serial/serial_core.c as my uart driver source.

Following is my test steps -- run command: cat /proc/interrupts two times contiguously.

[root@freescale /]# cat /proc/interrupts

M5445X    *90:       5099 UART*
M5445X    96:       3130 timer0
M5445X    99:          0 timer3
M5445X   100:       1569 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3098 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         41 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
[root@freescale /]# cat /proc/interrupts
M5445X    *90:       5714 UART*
M5445X    96:       3700 timer0
M5445X    99:          1 timer3
M5445X   100:       1574 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3108 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         47 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)

I find that the interrupts for above operation is 5714 - 5099 = 605 Is it normal? (my opinion it's too much)

I test it on the mcf5329 board, it has the same-like result (even more 605). Actually I don't modify any code of mcf.c and serial_core.c, but I don't know why so much interrupts are occurred through one operation?

Regards,
Lanttor

author
#1 lore raw
Quoted 58 lines

Hi,

I find one issue of UART on my coldfire platforms (mcf54451evb board). I use the linux-2.6.29, and use drivers/serial/mcf.c and drivers/serial/serial_core.c as my uart driver source.

Following is my test steps -- run command: cat /proc/interrupts two times contiguously.

[root@freescale /]# cat /proc/interrupts

M5445X    *90:       5099 UART*
M5445X    96:       3130 timer0
M5445X    99:          0 timer3
M5445X   100:       1569 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3098 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         41 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
[root@freescale /]# cat /proc/interrupts
M5445X    *90:       5714 UART*
M5445X    96:       3700 timer0
M5445X    99:          1 timer3
M5445X   100:       1574 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3108 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         47 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)

I find that the interrupts for above operation is 5714 - 5099 = 605 Is it normal? (my opinion it's too much)

I test it on the mcf5329 board, it has the same-like result (even more 605). Actually I don't modify any code of mcf.c and serial_core.c, but I don't know why so much interrupts are occurred through one operation?

Regards,
Lanttor

#4 lore raw
In reply to Lanttor
Quoted 44 lines · Lanttor

Hi,

I find one issue of UART on my coldfire platforms (mcf54451evb board). I use the linux-2.6.29, and use drivers/serial/mcf.c and drivers/serial/serial_core.c as my uart driver source.

Following is my test steps -- run command: cat /proc/interrupts two times contiguously.

[root@freescale /]# cat /proc/interrupts

M5445X    *90:       5099 UART*
M5445X    96:       3130 timer0
M5445X    99:          0 timer3
M5445X   100:       1569 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3098 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         41 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
[root@freescale /]# cat /proc/interrupts
M5445X    *90:       5714 UART*
M5445X    96:       3700 timer0
M5445X    99:          1 timer3
M5445X   100:       1574 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3108 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         47 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
Quoted 6 lines

I find that the interrupts for above operation is 5714 - 5099 = 605 Is it normal? (my opinion it's too much)

I test it on the mcf5329 board, it has the same-like result (even more 605). Actually I don't modify any code of mcf.c and serial_core.c, but I don't know why so much interrupts are occurred through one operation?

By the looks of it, the driver is interrupting per character (ie per byte). If you copy half your output above into a text editor, and count the characters, including one byte per line end, you get 605. I can't speak for the driver implementation, but it sounds fair enough to me. Cheers,
-- Matt

#2 lore raw
In reply to Lanttor

Hi Lanttor,

Quoted 44 lines · Lanttor
Quoted 44 lines

Hi,

I find one issue of UART on my coldfire platforms (mcf54451evb board). I use the linux-2.6.29, and use drivers/serial/mcf.c and drivers/serial/serial_core.c as my uart driver source.

Following is my test steps -- run command: cat /proc/interrupts two times contiguously.

[root@freescale /]# cat /proc/interrupts

M5445X    *90:       5099 UART*
M5445X    96:       3130 timer0
M5445X    99:          0 timer3
M5445X   100:       1569 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3098 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         41 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
[root@freescale /]# cat /proc/interrupts
M5445X    *90:       5714 UART*
M5445X    96:       3700 timer0
M5445X    99:          1 timer3
M5445X   100:       1574 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3108 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         47 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
Quoted 1 line
Quoted 1 line

I find that the interrupts for above operation is 5714 - 5099 = 605

                                                     ^^^^^^^^^^^^^ 615 ?
Quoted 1 line
Quoted 1 line

Is it normal? (my opinion it's too much)

Most of the ColdFire UART blocks have no transmit FIFO, so you are going to get 1 interrupt per character. The above block has at least 500 characters in it (including white space). Then include the extra command prompt and you typing (receive interrupts) and I would figure that is going to come to around 600 interrupts. So, yes, that seems about right.

Check the actual character count using:

cat /proc/tty/driver/mcf

Quoted 3 lines
Quoted 3 lines

I test it on the mcf5329 board, it has the same-like result (even more 605). Actually I don't modify any code of mcf.c and serial_core.c, but I don't know why so much interrupts are occurred through one operation?

That is the price you pay with no data FIFO's in these UART cores. (Some of the ColdFire parts support DMA with the UART - the mcf driver doesn't currently use this though).

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
author
#3 lore raw

Thanks Greg/Matt/Cris' reply. I know it's not the issue now :)

Quoted 10 lines

Most of the ColdFire UART blocks have no transmit FIFO, so you are going to get 1 interrupt per character. The above block has at least 500 characters in it (including white space). Then include the extra command prompt and you typing (receive interrupts) and I would figure that is going to come to around 600 interrupts. So, yes, that seems about right.

Check the actual character count using:

cat /proc/tty/driver/mcf

Indeed it is. The UART transmit Buffer in my board is 1 character size (no FIFO), only receiver has FIFO.

I test command "cat /proc/tty/driver/mcf", the result is as follows:

[root@freescale /]# cat /proc/tty/driver/mcf
serinfo:1.0 driver revision:
0: uart:ColdFire UART mmio:0xFC060000 irq:90 tx:54821 rx:91 RTS|DTR|CD [root@freescale /]# cat /proc/interrupts

M5445X    90:      55042 UART
M5445X    96:       9962 timer
M5445X    99:          2 timer
M5445X   100:       3761 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       8169 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:        110 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)

[root@freescale /]# cat /proc/tty/driver/mcf
serinfo:1.0 driver revision:
0: uart:ColdFire UART mmio:0xFC060000 irq:90 tx:55603 rx:115 RTS|DTR|CD

Thanks!

Regards,
Lanttor

------------------------------------------------------------------------
*From:* Greg Ungerer <[email protected]>
*Sent:* 07/02/2009 8:40:49 AM +0800
*To:* uClinux development list <[email protected]> *CC:* [email protected]
*Subject:* [uClinux-dev] uart issues on coldfire platform

Quoted 89 lines

Hi Lanttor,

Quoted 44 lines · Lanttor
Quoted 44 lines

Hi,

I find one issue of UART on my coldfire platforms (mcf54451evb board). I use the linux-2.6.29, and use drivers/serial/mcf.c and drivers/serial/serial_core.c as my uart driver source.

Following is my test steps -- run command: cat /proc/interrupts two times contiguously.

[root@freescale /]# cat /proc/interrupts

M5445X    *90:       5099 UART*
M5445X    96:       3130 timer0
M5445X    99:          0 timer3
M5445X   100:       1569 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3098 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         41 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
[root@freescale /]# cat /proc/interrupts
M5445X    *90:       5714 UART*
M5445X    96:       3700 timer0
M5445X    99:          1 timer3
M5445X   100:       1574 fec(TXF)
M5445X   101:          0 fec(TXB)
M5445X   102:          0 fec(TXFIFO)
M5445X   103:          0 fec(TXCR)
M5445X   104:       3108 fec(RXF)
M5445X   105:          0 fec(RXB)
M5445X   106:         47 fec(MII)
M5445X   107:          0 fec(LC)
M5445X   108:          0 fec(HBERR)
M5445X   109:          0 fec(GRA)
M5445X   110:          0 fec(EBERR)
M5445X   111:          0 fec(BABT)
M5445X   112:          0 fec(BABR)
Quoted 1 line
Quoted 1 line

I find that the interrupts for above operation is 5714 - 5099 = 605

                                                     ^^^^^^^^^^^^^ 615 ?
Quoted 1 line
Quoted 1 line

Is it normal? (my opinion it's too much)

Most of the ColdFire UART blocks have no transmit FIFO, so you are going to get 1 interrupt per character. The above block has at least 500 characters in it (including white space). Then include the extra command prompt and you typing (receive interrupts) and I would figure that is going to come to around 600 interrupts. So, yes, that seems about right.

Check the actual character count using:

cat /proc/tty/driver/mcf

Quoted 5 lines
Quoted 5 lines

I test it on the mcf5329 board, it has the same-like result (even more 605).
Actually I don't modify any code of mcf.c and serial_core.c, but I don't
know why so much interrupts are occurred through one operation?

That is the price you pay with no data FIFO's in these UART cores. (Some of the ColdFire parts support DMA with the UART - the mcf driver doesn't currently use this though).

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html