summaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/mn10300-serial.c
Commit message (Collapse)AuthorAgeFilesLines
* mn10300: Remove deprecated IRQF_DISABLEDMichael Opdenacker2014-03-041-3/+3
| | | | | | | | | | | | | This patch removes the IRQF_DISABLED flag from mn10300 architecture code. It's a NOOP since 2.6.35 and it will be removed one day. Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Cc: srivatsa.bhat@linux.vnet.ibm.com Cc: linux-am33-list@redhat.com Cc: dhowells@redhat.com Cc: yasutake.koichi@jp.panasonic.com Link: http://lkml.kernel.org/r/1393965111-17092-1-git-send-email-michael.opdenacker@free-electrons.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* TTY: mn10300-serial, fix build breakageJiri Slaby2013-01-161-10/+10
| | | | | | | | | | | | | By the recent `switch flipping' patches we introduced a build failure in the driver: mn10300-serial.c:527:19: error: 'port' redeclared as different kind of symbol I did not notice because I did not even find a compiler for that new architecture. Hopefully everything is all right now as I cannot test it. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* TTY: switch tty_flip_buffer_pushJiri Slaby2013-01-151-4/+3
| | | | | | | | | | | | | | | | | | | | Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. Now, the one where most of tty_port_tty_get gets removed: tty_flip_buffer_push. IOW we also closed all the races in drivers not using tty_port_tty_get at all yet. Also we move tty_flip_buffer_push declaration from include/linux/tty.h to include/linux/tty_flip.h to all others while we are changing it anyway. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* TTY: move low_latency to tty_portJiri Slaby2013-01-151-3/+3
| | | | | | | | | | One point is to have less places where we actually need tty pointer. The other is that low_latency is bound to buffer processing and buffers are now in tty_port. So it makes sense to move low_latency to tty_port too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* TTY: switch tty_insert_flip_charJiri Slaby2013-01-151-2/+2
| | | | | | | | | | | | | Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. tty_insert_flip_char is the next one to proceed. This one is used all over the code, so the patch is huge. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* TTY: switch tty_buffer_request_room to tty_portJiri Slaby2013-01-151-2/+3
| | | | | | | | | | | | Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty pointer in many call sites. Only tty_port will be needed and hence no more tty_port_tty_get calls in those paths. Here we start with tty_buffer_request_room. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MN10300: fix debug polling in ttySM driverMark Salter2012-12-121-12/+23
| | | | | | | | | | | | | | The debug polling interface for the SoC serial ports did not work in the case where the serial ports were not also used as a console. In that case, the uart driver startup function will not be called so tx and rx would not be enabled in the hardware control register. Also, vdma interrupts would not be enabled which the poll_get_char function relied on. This patch makes sure that the rx and tx enables are set as a consequence of the uart set_termios call which is the only initialization done for the debug polling interface. Also, the poll_get_char now handles the case where vdma interrupts are not enabled. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: ttySM: clean up unnecessary castingMark Salter2012-12-121-4/+4
| | | | | | | | The ttySM uart data register pointers are declared as void* pointers. Change them to u8* pointers so we don't need to use casts in the code. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: fix SMP synchronization between txdma and serial driverMark Salter2012-12-121-43/+78
| | | | | | | | | | | | | | | The SoC serial port driver uses a high priority interrupt to handle tx of characters in the tx ring buffer. The driver needs to disable/enable this IRQ from outside of irq context. The original code to do this is not foolproof on SMP machines because the IRQ running on one core could still access the serial port for a short time after the driver running on another core disables the interrupt. This patch adds a flag to tell the IRQ handler that the driver wants to disable the interrupt. After seeing the flag, the IRQ handler will immediately disable the interrupt and exit. After setting the flag, the driver will wait for interrupt to be disabled by the IRQ handler. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: fix serial port vdma irq setup for SMPMark Salter2012-12-121-4/+30
| | | | | | | | | | | | | | | The builtin SoC serial ports have no FIFOs and use a virtual DMA mechanism based on high priority IRQs to avoid overruns. These high priority interrupts are pinned to cpu#0 on SMP systems. This patch fixes a problem with SMP where the set_intr_level() interface is used to set the priority for these IRQs. The set_intr_level() function sets priority on the local cpu but on SMP systems, this code may be run on some other cpu than the one handling the interrupts. Instead of setting interrupt level explicitly, this patch uses a special irq_chip for these interrupts so that the mask/unmask methods can set the interrupt level implicitly. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: cleanup IRQ affinity settingMark Salter2012-12-121-3/+6
| | | | | | | | | | | | The irq_set_affinity handler for the mn10300 cpu pic had some hard-coded IRQs which were not to be migrated from one cpu to another. This patch cleans those up by using a combination of IRQF_NOBALANCING and specialized irq chips with no irq_set_affinity handler. This maintains the previous behavior by using generic IRQ interfaces rather than hard coding IRQ numbers in the default irq_set_affinity handler. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: ttySM: Use memory barriers correctly in circular buffer logicDavid Howells2012-12-121-6/+8
| | | | | | | | Use memory barriers correctly in the circular buffer logic used in the driver, as documented in Documentation/circular-buffers.txt. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Mark Salter <msalter@redhat.com>
* Disintegrate asm/system.h for MN10300David Howells2012-03-281-1/+0
| | | | | | | Disintegrate asm/system.h for MN10300. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-am33-list@redhat.com
* mn10300: Convert genirq namespaceThomas Gleixner2011-03-291-1/+1
| | | | | | Convert to new function names. Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* MN10300: Allow KGDB to use the MN10300 serial portsDavid Howells2011-03-181-0/+75
| | | | | | | | | | | | Allow KGDB to use the MN10300 serial ports through the polled I/O interface provided via the TTY/serial layer and the kgdboc driver. This allows the kernel to be started with something like: kgdboc=ttySM0,115200 added to the command line. Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: Convert serial irq_chip to new functionsThomas Gleixner2011-03-181-5/+10
| | | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: Remove stale irq_chip.end - V2Thomas Gleixner2011-03-181-1/+0
| | | | | | | irq_chip.end is obsolete with the removal of __do_IRQ(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: And Panasonic AM34 subarch and implement SMPAkira Takeuchi2010-10-271-29/+181
| | | | | | | | | | Implement the Panasonic MN10300 AM34 CPU subarch and implement SMP support for MN10300. Also implement support for the MN2WS0060 processor and the ASB2364 evaluation board which are AM34 based. Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com> Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com> Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: Fix up the IRQ names for the on-chip serial portsDavid Howells2010-09-141-11/+11
| | | | | | | | | | | | | Fix up the IRQ names for the MN10300 on-chip serial ports in the driver as request_interrupt() no longer allows names containing slashes, giving a warning like the following if one is encountered: ------------[ cut here ]------------ WARNING: at fs/proc/generic.c:323 __xlate_proc_name+0x62/0x7c() name 'ttySM0/Rx' Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Add a dummy printk function for the maintenance of unused printksDavid Howells2010-08-121-5/+0
| | | | | | | | Add a dummy printk function for the maintenance of unused printks through gcc format checking, and also so that side-effect checking is maintained too. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mn10300: add cc clobbers to asm statementsMark Salter2010-01-111-1/+2
| | | | | | | | | | | | | gcc 4.2.1 for MN10300 is more agressive than the older gcc in reordering/moving other insns between an insn that sets flags and an insn that uses those flags. This leads to trouble with asm statements which are missing an explicit "cc" clobber. This patch adds the explicit "cc" clobber to asm statements which do indeed clobber the condition flags. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* MN10300: Handle removal of struct uart_infoDavid Howells2009-09-231-7/+7
| | | | | | | | | Commit ebd2c8f6d2ec4012c267ecb95e72a57b8355a705 removed struct uart_info and commit bdc04e3174e18f475289fa8f4144f66686326b7e further moved delta_msr_wait. Fix up the MN10300 on-chip serial port drivers to comply with this. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Separate out the proc- and unit-specific header directories from the generalDavid Howells2009-04-101-1/+1
| | | | | | | | | | | MN10300 arch headers and place them instead in the same directories as contain the .c files for the processor and unit implementations. This permits the symlinks include/asm/proc and include/asm/unit to be dispensed with. This does, however, require that #include <asm/proc/xxx.h> be converted to #include <proc/xxx.h> and similarly for asm/unit -> unit. Signed-off-by: David Howells <dhowells@redhat.com>
* MN10300: Discard low-priority Tx interrupts when closing an on-chip serial portAkira Takeuchi2008-12-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discard low-prioriy Tx interrupts when closing an MN10300 on-chip serial port. The MN10300 on-chip serial port uses three interrupts to manage its serial ports: (1) A very high priority interrupt that drives virtual DMA for Rx. (2) A very high priority interrupt that drives virtual DMA for Tx. (3) A normal priority virtual interrupt that does the normal UART interrupt stuff and is shared between Rx and Tx. mn10300_serial_stop_tx() only disables the high priority Tx interrupt. It doesn't also disable the normal priority one because it is shared with Rx. However, the high priority interrupt may interrupt local_irq_disabled() sections, and so may have queued up a low priority virtual interrupt whilst the UART driver is asking for the Tx interrupt to be disabled. The result of this can be an oops when we try to process the interrupt in mn10300_serial_transmit_interrupt() as port->uart.info and port->uart.info->tty may have gone away. To deal with this, if either of those pointers is NULL, we make sure the high-priority Tx interrupt is disabled and discard the interrupt. The low priority interrupt is disabled by the mn10300_serial_pic irq_chip table. Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* removed unused #include <linux/version.h>'sAdrian Bunk2008-08-231-1/+0
| | | | | | | | This patch lets the files using linux/version.h match the files that #include it. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* MN10300: Fix MN10300's serial port driver to get at its tty_structDavid Howells2008-07-201-1/+1
| | | | | | | | | Fix MN10300's serial port driver to get at its tty_struct as this moved from struct uart_info into struct tty_port in patch: Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mn10300: add the MN10300/AM33 architecture to the kernelDavid Howells2008-02-081-0/+1480
Add architecture support for the MN10300/AM33 CPUs produced by MEI to the kernel. This patch also adds board support for the ASB2303 with the ASB2308 daughter board, and the ASB2305. The only processor supported is the MN103E010, which is an AM33v2 core plus on-chip devices. [akpm@linux-foundation.org: nuke cvs control strings] Signed-off-by: Masakazu Urade <urade.masakazu@jp.panasonic.com> Signed-off-by: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>