Skip to contentSkip to conversation

Try to make 8250 serial work on embedded platform

PATCH In review Bryan Wu 3 participants 5 messages May 12, 2008

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

cover Try to make 8250 serial work on embedded platform

Hi Alan and Andrew,

How do you think of this patch set?

Quoted 1 line

From Javier:

Without the first, the 8250-class UART does not work with the Blackfin, and without the second, you get a compilation error if you activate 8250 UARTs. Besides, I think that there is more people using 8250-class UARTs with a different hardware than the H8606 board.

Thanks
-Bryan

author
#1 lore raw

PATCH 1/2 : Added support for 8250-class UARTs in HV Sistemas H8606 board

From: Javier Herrero <[email protected]>

Added support for 8250-class UARTs in HV Sistemas H8606 board, modification in 8250.c driver for correct compilation with Blackfin

Besides, I think that there is more people using 8250-class UARTs with a different hardware than the H8606 board. This code can be shared by them.

---
 drivers/serial/8250.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/serial/8250.c +4 -0
index a1ca9b7..d171561 100644
@@ -1548,6 +1548,10 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
 		i->head = &up->list;
 		spin_unlock_irq(&i->lock);
 
+#ifdef SERIAL_EXTRA_IRQ_FLAGS
+		irq_flags |= SERIAL_EXTRA_IRQ_FLAGS;
+#endif
+
 		ret = request_irq(up->port.irq, serial8250_interrupt,
 				  irq_flags, "serial", i);
 		if (ret < 0)
Signature · 1 line
1.5.5
#2 lore raw

Re: [PATCH 1/2] [8250 Serial Driver]: Added support for 8250-class UARTs in HV Sistemas H8606 board

drivers/serial/8250.c static int serial_link_irq_chain(struct uart_8250_port *up) · line 1554

Quoted 5 lines
drivers/serial/8250.c +4 -0
+#ifdef SERIAL_EXTRA_IRQ_FLAGS
+		irq_flags |= SERIAL_EXTRA_IRQ_FLAGS;
+#endif
+

We try and keep ifdefs out of code. It is also not clear what you would do if you had a box where the extra flags depended on the port.

So two suggestions

Either

Add just the line

+ irq_flags |= SERIAL_EXTRA_IRQ_FLAGS;

and at the end of 8250.h do

#ifndef SERIAL_EXTRA_IRQ_FLAGS
#define SERIAL_EXTRA_IRQ_FLAGS 0
#endif

or the same but with an argument (unused for now)

SERIAL_EXTRA_IRQ_FLAGS(up)

Alan

#3 lore raw

Re: [PATCH 1/2] [8250 Serial Driver]: Added support for 8250-class UARTs in HV Sistemas H8606 board

Hello, Alan,

Thans, I will redo the patch in the way you suggest, test it and resend.

Regards,

Javier

Quoted 31 lines · Alan Cox

drivers/serial/8250.c static int serial_link_irq_chain(struct uart_8250_port *up) · line 1554

Quoted 5 lines
drivers/serial/8250.c +4 -0
+#ifdef SERIAL_EXTRA_IRQ_FLAGS
+		irq_flags |= SERIAL_EXTRA_IRQ_FLAGS;
+#endif
+

We try and keep ifdefs out of code. It is also not clear what you would do if you had a box where the extra flags depended on the port.

So two suggestions

Either

Add just the line

drivers/serial/8250.c +1 -0
+		irq_flags |= SERIAL_EXTRA_IRQ_FLAGS;

and at the end of 8250.h do

#ifndef SERIAL_EXTRA_IRQ_FLAGS
#define SERIAL_EXTRA_IRQ_FLAGS 0
#endif

or the same but with an argument (unused for now)

SERIAL_EXTRA_IRQ_FLAGS(up)

Alan

Signature · 5 lines
------------------------------------------------------------------------
Javier Herrero                            EMAIL: [email protected]
HV Sistemas S.L.                          PHONE:         +34 949 336 806
Los Charcones, 17A                        FAX:           +34 949 336 792
19170 El Casar - Guadalajara - Spain      WEB: http://www.hvsistemas.com 
author
#4 lore raw

PATCH 2/2 serial driver: add extra IRQ flag for 8250 serial driver

In reply to Bryan Wu

From: Javier Herrero <[email protected]>

---
 include/asm-blackfin/serial.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-blackfin/serial.h
include/asm-blackfin/serial.h new file +5 -0
new file mode 100644
index 0000000..994dd86
@@ -0,0 +1,5 @@
+/*
+ * include/asm-blackfin/serial.h
+ */
+
+#define SERIAL_EXTRA_IRQ_FLAGS IRQF_TRIGGER_HIGH
Signature · 1 line
1.5.5