* Re: [PATCH] sh-sci: console drainage
@ 2009-03-03 6:18 Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2009-03-03 6:18 UTC (permalink / raw)
To: linux-sh
On Tue, Feb 24, 2009 at 03:57:12PM +0900, Magnus Damm wrote:
> Modify the serial console code to wait for the transmit FIFO,
> make sure all bits have been put on the wire before returning.
On Tue, Feb 24, 2009 at 10:11:03PM +0900, Magnus Damm wrote:
> Add support for single IRQ hardware to the sh-rtc driver.
>
> This is useful for processors with limited interrupt masking
> support such as sh7750 and sh7780. With this patch in place we
> can add logic to the intc code that merges all RTC vectors into
> a single linux interrupt with proper masking/unmasking support.
>
> Specify a single IRQ in the platform data to use this new shared
> IRQ feature. Separate Periodic/Carry/Alarm IRQs are still supported.
On Tue, Feb 24, 2009 at 10:23:51PM +0900, Magnus Damm wrote:
> Fix iounmap() of pass-through P4 addresses. Without this patch
> iounmap() on the sh7780 rtc area results in a warning message.
On Tue, Feb 24, 2009 at 10:58:57PM +0900, Magnus Damm wrote:
> Instead of keeping the single vector -> single linux irq mapping
> we extend the intc code to support merging of vectors to a single
> linux irq. This helps processors such as sh7750, sh7780 and sh7785
> which have more vectors than masking ability. With this patch in
> place we can modify the intc tables to use one irq per maskable
> irq source. Please note the following:
>
> - If multiple vectors share the same enum then only the
> first vector will be available as a linux irq.
>
> - Drivers may need to be rewritten to get pending irq
> source from the hardware block instead of irq number.
>
> This patch together with the sh7785 specific intc tables solves
> DMA controller irq issues related to buggy interrupt masking.
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> Reported-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Please try to keep the flow consistent here. Reported-by should always be
first, while Tested-by and so on tend to follow your Signed-off-by.
On Tue, Feb 24, 2009 at 10:59:04PM +0900, Magnus Damm wrote:
> Update intc tables and platform data to use one linux irq
> per maskable interrupt source instead of keeping the one-to-one
> mapping between vectors and linux irqs.
>
> This fixes potential irq masking issues for sh775x hardware
> blocks such as SCI/SCIF/RTC/DMAC/TMU2/REF.
On Tue, Feb 24, 2009 at 10:59:12PM +0900, Magnus Damm wrote:
> Update intc tables and platform data to use one linux irq
> per maskable interrupt source instead of keeping the one-to-one
> mapping between vectors and linux irqs.
>
> This fixes potential irq masking issues for sh7780 hardware
> blocks such as SCIF/RTC/DMAC/PCIC5/MMCIF/FLCTL/GPIO
On Tue, Feb 24, 2009 at 10:59:19PM +0900, Magnus Damm wrote:
> Update intc tables and platform data to use one linux irq
> per maskable interrupt source instead of keeping the one-to-one
> mapping between vectors and linux irqs.
>
> This fixes potential irq masking issues for sh7785 hardware
> blocks such as SCIF/DMAC/PCIC5/MMCIF/GDTA/FLCTL/GPIO
All applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] sh-sci: console drainage
@ 2009-02-24 6:57 Magnus Damm
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2009-02-24 6:57 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
Modify the serial console code to wait for the transmit FIFO,
make sure all bits have been put on the wire before returning.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
This is the first step against clock framework integration,
after all bits are sent we can disable the data clock.
Also useful when debugging or shutting down a system.
Tested with SCIF on sh7785lcr, not sure about SCI and SCIFA.
drivers/serial/sh-sci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- 0001/drivers/serial/sh-sci.c
+++ work/drivers/serial/sh-sci.c 2009-02-18 15:59:05.000000000 +0900
@@ -139,7 +139,7 @@ static void sci_poll_put_char(struct uar
} while (!(status & SCxSR_TDxE(port)));
sci_in(port, SCxSR); /* Dummy read */
- sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
+ sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
sci_out(port, SCxTDR, c);
}
#endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
@@ -1095,6 +1095,7 @@ static void serial_console_write(struct
unsigned count)
{
struct uart_port *port = &serial_console_port->port;
+ unsigned short bits;
int i;
for (i = 0; i < count; i++) {
@@ -1103,6 +1104,11 @@ static void serial_console_write(struct
sci_poll_put_char(port, *s++);
}
+
+ /* wait until fifo is empty and last bit has been transmitted */
+ bits = SCxSR_TDxE(port) | SCxSR_TEND(port);
+ while ((sci_in(port, SCxSR) & bits) != bits)
+ cpu_relax();
}
static int __init serial_console_setup(struct console *co, char *options)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-03 6:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03 6:18 [PATCH] sh-sci: console drainage Paul Mundt
-- strict thread matches above, loose matches on Subject: below --
2009-02-24 6:57 Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox