Skip to contentSkip to conversation

serial driver PMC MSP71xx, kernel linux-mips.git mast er

PATCH Marc St-Jean 3 participants 3 messages Jan 23, 2007 – Jan 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Alan
Quoted 2 lines

There are three different fixes:
1. Fix for THRE errata

That should be handled anyway. The current code actually spots this and uses a backup timer for dodgy UARTS

Thanks, I'll retest without this fix on the current l-m.o git master and see if it still solves our errata.

Quoted 14 lines
Quoted 14 lines

2. Fix for Busy Detect on LCR write
3. Workaround for interrupt/data concurrency issue

case UPIO_MEM:

(quoted diff) +9 -0
+#ifdef CONFIG_PMC_MSP
+             /* Save the LCR value so it can be re-written when a
+              * Busy Detect interrupt occurs. */
+             if (dwapb_offset == UART_LCR)
+                     up->dwapb_lcr = value;
+#endif
              writeb(value, up->port.membase + offset);
+#ifdef CONFIG_PMC_MSP
+             /* Re-read the IER to ensure any interrupt disabling has
+              * completed before proceeding with ISR. */
Quoted 8 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+             if (dwapb_offset == UART_IER)
+                     value = serial_in(up, dwapb_offset);
+#endif
              break;

This I would hope you can hide in the platform specific serial_in/serial_out functions. If you write the UART_LCR save it in serial_out(), if you read IER etc.

I couldn't find hooks for platform specific serial_in/out functions. Do you mean using the up->port.iotype's in serial_in/out from 8250.c?

Quoted 9 lines

Review

Quoted 5 lines
(quoted diff) +4 -0
+#ifdef CONFIG_PMC_MSP
+             } else if ((iir & UART_IER_BUSY) == UART_IER_BUSY) {
+                     /*
+                      * The MSP (DesignWare APB UART) serial 

subsystem has a

Quoted 1 line

+ * non-standard interrupt condition (0x7) which

means

Quoted 1 line

+ * that the LCR was written while the UART was

Quoted 8 lines

busy, so

Quoted 1 line

+ * the LCR was not actually written. It is

cleared by

Quoted 1 line

+ * reading the special non-standard extended

UART status

Quoted 1 line

+ * register.

Ditto... spot this case and whack it in your serial methods.

A serial_in(up, UART_IIR) calls occur in more places that just the interrupt handler (i.e. autoconfig*, serial8250_start_tx, etc). We will need to check if we are in an interrupt on each IIR read, hopefully that won't be too much overhead!

Quoted 4 lines

And we might want to add a void * for board specific insanity to the 8250 structures if we really have to so you can hang your brain damage privately off that ?

Sounds good to me, it would give us a location to store the address of the UART_STATUS_REG required by this UART variant.

Marc

#1 lore raw
Quoted 6 lines · On Tue, 23 Jan 2007 14:37:23 -0800 Marc St-Jean <[email protected]>…
Quoted 3 lines

This I would hope you can hide in the platform specific serial_in/serial_out functions. If you write the UART_LCR save it in serial_out(), if you read IER etc.

I couldn't find hooks for platform specific serial_in/out functions. Do you mean using the up->port.iotype's in serial_in/out from 8250.c?

If you can have other uarts as well then yes. Basically I want all the ugliness to belong to you not to the 8250 driver (and ditto for any other half baked uart or demented piece of broken glue logic). If we don't do that then 8250.c will end up unmanagable. So long as you crap in your own pond everyone else is fine ;)

Quoted 4 lines

A serial_in(up, UART_IIR) calls occur in more places that just the interrupt handler (i.e. autoconfig*, serial8250_start_tx, etc). We will need to check if we are in an interrupt on each IIR read, hopefully that won't be too much overhead!

Or if need be we make that hint generally available as we can do that bit cleanly.

Quoted 7 lines
Quoted 4 lines

And we might want to add a void * for board specific insanity to the 8250 structures if we really have to so you can hang your brain damage privately off that ?

Sounds good to me, it would give us a location to store the address of the UART_STATUS_REG required by this UART variant.

and for anything harder people can hang a struct off it.

Alan

#2 lore raw
In reply to Marc St-Jean

Hello.

Quoted 23 lines · Marc St-Jean
Quoted 14 lines
Quoted 14 lines

2. Fix for Busy Detect on LCR write
3. Workaround for interrupt/data concurrency issue

case UPIO_MEM:

(quoted diff) +9 -0
+#ifdef CONFIG_PMC_MSP
+             /* Save the LCR value so it can be re-written when a
+              * Busy Detect interrupt occurs. */
+             if (dwapb_offset == UART_LCR)
+                     up->dwapb_lcr = value;
+#endif
              writeb(value, up->port.membase + offset);
+#ifdef CONFIG_PMC_MSP
+             /* Re-read the IER to ensure any interrupt disabling has
+              * completed before proceeding with ISR. */
Quoted 8 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+             if (dwapb_offset == UART_IER)
+                     value = serial_in(up, dwapb_offset);
+#endif
              break;

This I would hope you can hide in the platform specific serial_in/serial_out functions. If you write the UART_LCR save it in serial_out(), if you read IER etc.

Quoted 1 line

I couldn't find hooks for platform specific serial_in/out functions.

It's because there are none. :-)

Quoted 1 line

Do you mean using the up->port.iotype's in serial_in/out from 8250.c?

Not sure what Alan meant, but this seems the only option for now.

Quoted 6 lines
Quoted 3 lines

And we might want to add a void * for board specific insanity to the 8250 structures if we really have to so you can hang your brain damage privately off that ?

Sounds good to me, it would give us a location to store the address of the UART_STATUS_REG required by this UART variant.

I doubt we really need to *store* it somewhere. Isn't it an fixed offset
from UART's base (I haven't seen the header)?

Quoted 1 line

Marc

MBR, Sergei