summaryrefslogtreecommitdiffstats
path: root/drivers/serial/sh-sci.c
Commit message (Collapse)AuthorAgeFilesLines
* serial: sh-sci: using correct fifo size for SCIF and SCIFA ports.Markus Pietrek2010-01-151-1/+12
| | | | | | | | | The sh-sci driver used the wrong fifosize for PORT_SCIFA and PORT_SCIF ports. If an incorrect size is used, the serial core will enforce an early shutdown on the port, especially with baudrates < 9600. Signed-off-by: Markus Pietrek <Markus.Pietrek@emtrion.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Convert tremaining ctrl_xxx I/O routines to __raw_xxx.Paul Mundt2009-12-241-2/+2
| | | | | | | | | ctrl_xxx() is an antiquated SH interface, while __raw_xxx is the standard API that accomplishes the same thing. As such, this converts the remaining sh-sci straggles over, which enables the driver to be wired up for ARM SH-Mobile CPUs as well. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: earlyprintk zero uartclk fixMagnus Damm2009-12-241-3/+13
| | | | | | | | This establishes a sensible max baud rate for the earlyprintk cases where the port's uartclk has not yet been determined. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds2009-12-161-9/+45
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (33 commits) sh: Fix test of unsigned in se7722_irq_demux() sh: mach-ecovec24: Add FSI sound support sh: mach-ecovec24: Add mt9t112 camera support sh: mach-ecovec24: Add tw9910 support sh: MSIOF/mmc_spi platform data for the Ecovec24 board sh: ms7724se: Add ak4642 support sh: Fix up FPU build for SH5 sh: Remove old early serial console code V2 sh: sh5 scif pdata (sh5-101/sh5-103) sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3) sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724) sh: sh4 scif pdata (sh7750/sh7760/sh4-202) sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720) sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg) sh: sh2 scif pdata (sh7616) sh-sci: Extend sh-sci driver with early console V2 sh: Stub in P3 ioremap support for nommu parts. sh: wire up vmallocinfo support in ioremap() implementations. sh: Make the unaligned trap handler always obey notification levels. sh: Couple kernel and user write page perm bits for CONFIG_X2TLB ...
| * sh-sci: Extend sh-sci driver with early console V2Magnus Damm2009-12-151-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | This is V2 of early serial console support for the sh-sci driver. The early serial console is using early platform devices and "earlyprintk". To use this feature the early platform devices must be broken out to one device per port and the desired port should be selected on the kernel command line like: "earlyprintk=sh-sci.N[,baudrate][,keep]" Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | const: constify remaining dev_pm_opsAlexey Dobriyan2009-12-151-1/+1
|/ | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* serial: sh-sci: Fix too early port disabling.Guennadi Liakhovetski2009-12-041-2/+2
| | | | | | | | | | | | | Currently serial ports on SH CPUs get disabled too early, because the sci_tx_empty() routine claims to not be able to detect whether the transmission has been completed and just always returns TIOCSER_TEMT. This results in corrupt output of last characters if the port is not open for reading at the same time. It is however possible to detect whether transmission has been completed. Use the TEND bit of the status register for this. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Depend on HAVE_CLK unconditionally.Paul Mundt2009-11-251-52/+1
| | | | | | | | | | | | | The sh-sci code conditionalized the clock framework support in order to give the other platforms a chance to catch up. sh64 supported this some time ago and the forthcoming ARM changes handle this as well, this leaves h8300 as the odd one out. H8300 has had since 2.5 to merge it's sh-sci support upstream, and has yet to do so. At this point I will no longer be holding back the driver to support an unreponsive architecture, 7 years is quite enough of a grace period. Support is easily implemented on the architecture if and when it ever decides to merge its changes upstream. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: don't use __devexit_p to wrap sci_removeUwe Kleine-König2009-11-251-1/+1
| | | | | | | | | | The function sci_remove is defined without any section modifier, so don't use __devexit_p to wrap it. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Magnus Damm <damm@opensource.se> Cc: linux-kernel@vger.kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: disable callback typo fixMagnus Damm2009-11-061-1/+1
| | | | | | | Avoid invoking the disable callback in case of NULL. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: kill off uart_infoAlan Cox2009-09-191-5/+5
| | | | | | | | We moved this into uart_state, now move the fields out of the separate structure and kill it off. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sh: Add initial support for SH7757 CPU subtypeYoshihiro Shimoda2009-08-211-1/+2
| | | | | Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Rework irqflags tracing to fix up CONFIG_PROVE_LOCKING.Stuart Menefy2009-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up the irqflags tracing code quite a bit and ties it in to various missing callsites that caused an imbalance when CONFIG_PROVE_LOCKING was enabled. Previously this was catching on: 987 #ifdef CONFIG_PROVE_LOCKING 988 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); 989 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 990 #endif 991 retval = -EAGAIN; with hardirqs being doubly enabled, and subsequently bailing out with the following call trace: Call trace: [<88035224>] __lock_acquire+0x616/0x6a6 [<88015a8c>] do_fork+0xf8/0x2b0 [<880331ec>] trace_hardirqs_on_caller+0xd4/0x114 [<88241074>] _spin_unlock_irq+0x20/0x64 [<88035224>] __lock_acquire+0x616/0x6a6 [<8800386c>] kernel_thread+0x48/0x70 [<88024ecc>] ____call_usermodehelper+0x0/0x110 [<88024ecc>] ____call_usermodehelper+0x0/0x110 [<88003894>] kernel_thread_helper+0x0/0x14 [<88024bac>] __call_usermodehelper+0x38/0x70 [<88025dc0>] worker_thread+0x150/0x274 [<88035b9c>] lock_release+0x0/0x198 [<88024b74>] __call_usermodehelper+0x0/0x70 [<88028cf0>] autoremove_wake_function+0x0/0x30 [<88028bf2>] kthread+0x3e/0x70 [<88025c70>] worker_thread+0x0/0x274 [<8800389c>] kernel_thread_helper+0x8/0x14 [<88028bb4>] kthread+0x0/0x70 [<88003894>] kernel_thread_helper+0x0/0x14 Reported-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: fix sci interrupt handlerSUGIOKA Toshinobu2009-07-071-4/+4
| | | | | | | Fix up the error bit handling on SCI ports. Signed-off-by: SUGIOKA Toshinobu <sugioka@itonet.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: update receive error handling for muxed irqsMagnus Damm2009-07-031-3/+4
| | | | | | | | | | | | | | | | | This patch updates the receive error code for muxed interrupts in the sh-sci driver. Receive error interrupts may be generated by the hardware if RE or REIE bits in SCSCR are set. Update the muxed interrupt handling code to acknowledge error interrupts if RE or REIE is set, instead of only acknowledging if REIE is set. Without this patch error interrupts may be generated but never acked resulting in a "nobody cared" crash. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Move over to dev_pm_ops.Paul Mundt2009-06-151-8/+10
| | | | | | | Presently the boot log whines about suspend/resume hooks at the platform driver level, move these over to dev_pm_ops. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Fix up PORT_SCI console output ordering.SUGIOKA Toshinobu2009-06-021-2/+1
| | | | | | | | | | Fix SCI transmission sequence in console output function. This reorders the write sequence to match the SH-3 manual, and corrects a console corruption bug observed on SH-3 SCI. Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: module_clk -> peripheral_clk rename.Paul Mundt2009-05-131-1/+1
| | | | | | | For consistenct naming, and to allow us to fix up some confusion in the SH-Mobile clock framework, amongst other places. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Fix up h8300 support.Yoshinori Sato2009-05-081-0/+4
| | | | | | | | - Dummy SCIF functions define. - h8300 specific header include. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Fix up section mismatch in error path.Paul Mundt2009-05-081-1/+1
| | | | | | | | The sci_probe_single() path attempts to use sci_remove() for the error path, while sci_remove() is still flagged as __devexit. So, we simply discard the section annotation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: improve clock framework supportMagnus Damm2009-05-081-31/+46
| | | | | | | | Use enable/disable hooks for clock framework integration. Make sure we control the clock for the serial console as well. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: ioremap() in a single placeMagnus Damm2009-05-081-34/+20
| | | | | | | Handle ioremap() in sci_config_port only. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: replace sci_init_ports()Magnus Damm2009-05-081-57/+50
| | | | | | | Replace sci_init_ports() with sci_init_single(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: allow single port platform devicesMagnus Damm2009-05-081-53/+72
| | | | | | | Allow registration of single port sh-sci platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: use to_sci_port() if possibleMagnus Damm2009-05-081-5/+5
| | | | | Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: rework serial console supportMagnus Damm2009-05-081-24/+23
| | | | | | | Rework sh-sci serial console code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: remove early_sci_setup()Magnus Damm2009-05-081-14/+0
| | | | | | | Remove unused early_sci_setup() function from sh-sci. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh-sci: add platform device private dataMagnus Damm2009-05-081-42/+85
| | | | | | | This patch adds per-platform private data to the sh-sci driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Integrate the SH-5 onchip_remap() more coherently.Paul Mundt2009-05-071-6/+0
| | | | | | | | | | | Presently this is special-cased for early initialization. While there are situations where these static early initializations are still necessary, with minor changes it is possible to use this for the regular ioremap implementation as well. This allows us to kill off the special-casing for the remap completely and to start tidying up all of the SH-5 special-casing in drivers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add support for SH7786 CPU subtype.Kuninori Morimoto2009-03-031-1/+3
| | | | | | | | | | | | | | This adds preliminary support for the SH7786 CPU subtype. While this is a dual-core CPU, only UP is supported for now. L2 cache support is likewise not yet implemented. More information on this particular CPU subtype is available at: http://www.renesas.com/fmwk.jsp?cnt=sh7786_root.jsp&fp=/products/mpumcu/superh_family/sh7780_series/sh7786_group/ Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: console drainageMagnus Damm2009-02-271-1/+7
| | | | | | | | 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> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Fix up port pinmux for SH7366.Paul Mundt2008-12-221-1/+1
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: sci_poll_get_char() is only used by CONFIG_CONSOLE_POLL.Paul Mundt2008-12-221-0/+3
| | | | | | | | sci_poll_put_char() happens to also be used by the serial console, while sci_poll_get_char() is only used by CONFIG_CONSOLE_POLL. Add another gnarly ifdef to shut up the compiler. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Generalize port pin initialization.Paul Mundt2008-12-221-102/+43
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Tidy up fifo overrun error handling.Paul Mundt2008-12-221-21/+24
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: pr_debug() -> dev_dbg() conversion.Paul Mundt2008-12-221-23/+26
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Fix up the cpufreq notifier to use the proper port clock.Paul Mundt2008-12-221-28/+10
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Implement CONSOLE_POLL support and kill off old kgdb console.Paul Mundt2008-12-221-181/+20
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Codestyle cleanup patch.Michael Trimarchi2008-12-221-56/+74
| | | | | | | Trivial coding style cleanups. Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: Reorder the SCxTDR write after the TDxE clear.Paul Mundt2008-11-131-1/+1
| | | | | | | | | | | | Under qemu there is a race between the TDxE read-and-clear and the SCxTDR write. While on hardware it can be gauranteed that the read-and-clear will happen prior to the character being written out, no such assumption can be made under emulation. As this path happens with IRQs off and the hardware itself doesn't care about the ordering, move the SCxTDR write until after the read-and-clear. Signed-off-by: Vladimir Prus <vladimir@codesourcery.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* serial: sh-sci: fix cannot work SH7723 SCIFAYoshihiro Shimoda2008-11-121-9/+11
| | | | | | | | SH7723 has SCIFA. This module is similer SCI register map, but it has FIFO. So this patch adds new type(PORT_SCIFA) and change some type checking. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up the shared IRQ demuxer's control bit testing logic.Michael Trimarchi2008-10-311-11/+12
| | | | | | | | | Correct the interrupt handler in sh4 serial device, return the correct value and check for what is anabled in the SCSCR register. The sh7722 is broken just sending a break using minicom. Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branches 'sh/serial-rework' and 'sh/oprofile'Paul Mundt2008-10-281-16/+1
|\
| * serial: sh-sci: Kill off all of the SCI/SCIF special casing.Paul Mundt2008-10-021-16/+1
| | | | | | | | | | | | | | | | This was added at a time when the compiler did a less than stellar job of optimizing out dead code. These days this tends to be less of a concern, so kill it all off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'genirq-v28-for-linus' of ↵Linus Torvalds2008-10-201-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip This merges branches irq/genirq, irq/sparseirq-v4, timers/hpet-percpu and x86/uv. The sparseirq branch is just preliminary groundwork: no sparse IRQs are actually implemented by this tree anymore - just the new APIs are added while keeping the old way intact as well (the new APIs map 1:1 to irq_desc[]). The 'real' sparse IRQ support will then be a relatively small patch ontop of this - with a v2.6.29 merge target. * 'genirq-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (178 commits) genirq: improve include files intr_remapping: fix typo io_apic: make irq_mis_count available on 64-bit too genirq: fix name space collisions of nr_irqs in arch/* genirq: fix name space collision of nr_irqs in autoprobe.c genirq: use iterators for irq_desc loops proc: fixup irq iterator genirq: add reverse iterator for irq_desc x86: move ack_bad_irq() to irq.c x86: unify show_interrupts() and proc helpers x86: cleanup show_interrupts genirq: cleanup the sparseirq modifications genirq: remove artifacts from sparseirq removal genirq: revert dynarray genirq: remove irq_to_desc_alloc genirq: remove sparse irq code genirq: use inline function for irq_to_desc genirq: consolidate nr_irqs and for_each_irq_desc() x86: remove sparse irq from Kconfig genirq: define nr_irqs for architectures with GENERIC_HARDIRQS=n ...
| * drivers/serial: use nr_irqsYinghai Lu2008-10-161-1/+1
| | | | | | | | | | Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | Merge branch 'sh/g3-prep'Paul Mundt2008-10-021-12/+33
|\ \
| * | serial: sh-sci: Handle the general UPF_IOREMAP case.Paul Mundt2008-10-011-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | Presently we don't do much with UPF_IOREMAP other than special case it for SH-5's onchip_remap() on the early console. Tie this in generically for platforms that need the remap. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | serial: sh-sci: Dynamic clock management depends on HAVE_CLK.Paul Mundt2008-10-021-28/+15
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Presently this is conditionalized on sh, and disabled for sh64. Now that SH-5 ties in to the clock framework, the sh64 exception can be dropped. Additionally, ARM will want to use the same hooks once SH-Mobile G3 grows clock framework support, so switch these paths over to HAVE_CLK now. Once the H8 and ARM sh-sci users hook up HAVE_CLK, the driver can be switched over to having an outright dependency on it and the ifdefs can go away. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* / sh: fixup many sparse errors.Paul Mundt2008-09-081-1/+1
|/ | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>