summaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel/bfin_dma_5xx.c
AgeCommit message (Collapse)Author
2012-03-21blackfin:dma: rename bfin_dma_5xx.c to bfin_dma.cBob Liu
bfin_dma_5xx is not a generic name for all blackfin chips. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
2011-05-25Blackfin: work around anomaly 05000480Steven Miao
Anomaly 05000480 on BF537 rev 0.0, 0.1, 0.2: Multiple Simultaneous Urgent DMA Requests May Cause DMA System Instability Suggested Workaround: Program the DMA Traffic Control Period to a non-zero value. This forces the DMA block to group accesses together rather than allow arbitration for each piece of data placed on the internal DMA bus. Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18Blackfin: bf54x: add kconfig for UART2/3 DMA channel assignmentssteven miao
The BF54x lacks dedicated DMA channels for the UART peripherals and need to be muxed between others. So add a kconfig option so people can select which channels the UARTs will use so they can pick between SPORTs and the less commonly used EPPI/PIXC peripherals. Signed-off-by: steven miao <realmz6@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-06Blackfin: fix DMA/cache bug when resuming from suspend to RAMMichael Hennerich
The dma_memcpy() function takes care of flushing different caches for us. Normally this is what we want, but when resuming from mem, we don't yet have caches enabled. If these functions happen to be placed into L1 mem (which is what we're trying to relocate), then things aren't going to work. So define a non-cache dma_memcpy() variant to utilize in situations like this. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-03-09Blackfin: remove trailing space in messagesFrans Pop
Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15Blackfin: reject NULL callback in set_dma_callback()Mike Frysinger
It makes no sense to call this function with a NULL callback. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15Blackfin: convert DMA mutex to an atomic and drop redundant codeMike Frysinger
The DMA channel status field was encoding redundant info wrt the DMA MMR config register, and it was doing an incomplete job of checking all DMA channels (some drivers write directly to the config register). So drop the tristate field in favor of a binary atomic field. This simplifies the code in general, removes the implicit need for sleeping, and forces the suspend code to handle all channels properly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-25Blackfin: fix suspend/resume failure with some on-chip ROMsMichael Hennerich
Some Blackfin on-chip ROMs utilize some MDMA channels during the suspend and resume process, but don't clean up after themselves. So manually clear all DMA channels when resuming since no DMA could have been running at this point in time. Now Linux should be able to work regardless of any laziness on the part of the on-chip ROM or boot loader. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-07Blackfin: mass clean up of copyright/licensing infoRobin Getz
Bill Gatliff & David Brownell pointed out we were missing some copyrights, and licensing terms in some of the files in ./arch/blackfin, so this fixes things, and cleans them up. It also removes: - verbose GPL text(refer to the top level ./COPYING file) - file names (you are looking at the file) - bug url (it's in the ./MAINTAINERS file) - "or later" on GPL-2, when we did not have that right It also allows some Blackfin-specific assembly files to be under a BSD like license (for people to use them outside of Linux). Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: fix read buffer overflowRoel Kluin
Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: catch hardware errors earlier during bootingRobin Getz
Allow hardware errors to be caught during early portions of booting, and leave something in the shadow console that people can use to debug their system with (to be printed out by the bootloader on next reset). This enables the hardare error interrupts in head.S, allowing us to find hardware errors when they happen (well, as much as you can with a hardware error) and prints out the trace if it is enabled. This will catch errors (like booting the wrong image on a 533) which previously resulted in a infinite loop/hang, as well as random hardware errors before before setup_arch(). To disable this debug only feature - turn off EARLY_PRINTK. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: fix early_dma_memcpy() handling of busy channelsMike Frysinger
The early logic to locate a free DMA channel and then set it up was broken in a few ways that only manifested itself when we needed to set up more than 2 on chip SRAM regions (most board defaults setup 1 or 2). First, we checked the wrong status register (the destination gets updated, not the source) and second, we did the ssync before rather than after resetting a DMA config register. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13Blackfin: rename bfin_addr_dcachable to bfin_addr_dcacheableJie Zhang
The latter naming convention is much more common. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: annotate anomaly 05000119 in core DMA codeRobin Getz
Add a reminder note to avoid the DMA_DONE bit in our DMA core code. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: fix early L1 relocation crashRobin Getz
Our early L1 relocate code may implicitly call code which lives in L1 memory. This is due to the dma_memcpy() rewrite that made the DMA code lockless and safe to be used by multiple processes. If we start the early DMA memcpy to relocate things into L1 instruction but then our DMA memcpy code calls a function that lives in L1, things fall apart. As such, create a small dedicated DMA memcpy routine that we can assume sanity at boot time. Reported-by: Filip Van Rillaer <filip.vanrillaer@oneaccess-net.com> Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-04Blackfin arch: fix bug - Dmacopy failed in BF537-STAMPMike Frysinger
Dmacopy failed in BF537-STAMP when copy from SRAM to SDRAM and kernel will reboot automatically. Fixing by doing a SSYNC before mucking with DMA registers Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: push cache flushing up to dma_memcpyMike Frysinger
push cache flushing up to dma_memcpy() so that we call the flush functions just once Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: request_dma() returns 0 on success, not channelMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: move most dma functions into static inlinesMike Frysinger
move most dma functions into static inlines since they are vastly 1 liners that get/set a value in a structure Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: set_dma_callback: do not store .irqMike Frysinger
set_dma_callback: do not store .irq if request_irq() failed so we dont turn around and attempt to free_irq() it later on in free_dma() Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: drop irq_callback from struct dma_channelMike Frysinger
the irq member already serves the same purpose Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: drop custom dma_interrupt_t and just use irq_handler_tMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: rewrite dma_memcpy() and dma in/out functionsMike Frysinger
- unify all dma in/out functions (takes ~35 lines of code now) - unify dma_memcpy with dma in/out functions (1 place that touches MDMA0 registers) - add support for 32bit transfers - cleanup dma_memcpy code to be much more readable - irqs are disabled only while programming MDMA registers rather than the entire transaction Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: check pointers in safe_dma_memcpyMike Frysinger
Check pointers in safe_dma_memcpy as this is the entry point for user-space code Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: push bf561 PERIPHERAL_MAP oddity into bf561-specific codeMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: dma_memcpy() - do not return NULL when transferring a ↵Mike Frysinger
multiple of 65k Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: rename MAX_BLACKFIN_DMA_CHANNEL to MAX_DMA_CHANNELS to match ↵Mike Frysinger
everyone else Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: add const to some function prototype and struct dma_channelMichael McTernan
Signed-off-by: Michael McTernan <mmcternan@airvana.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: implement support for /proc/dmaGraf Yang
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-29Blackfin arch: remove most BUG_ON channel checksMichael Hennerich
keep BUG_ON in DMA request, free and set_dma_callback. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-28Blackfin arch: Remove useless SSYNCs in DMA codeMichael Hennerich
Tons of SSYNC operation will impact the DMA performance Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-28Blackfin arch: lookup channel2irq() only onceMichael Hennerich
Add irq to struct dma_channel lookup channel2irq() only once, since channel2irq() is fairly large on some Blackfin derivatives. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-28Blackfin arch: remove unused local defineMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-13Blackfin Serial Driver: Fix bug - request UART2/3 peripheral mapped ↵Sonic Zhang
interrupts in PIO mode Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26Blackfin arch: fix bug - IMDMA is not type struct dma_registerMichael Hennerich
TEMP Workaround - avoid access to PERIPHERAL_MAP Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-07-19Blackfin arch: Functional power management supportMichael Hennerich
Enable: PM_SUSPEND_MEM -> Blackfin Hibernate to SDRAM This feature requires a special bootloader (u-boot) supporting return from hibernate. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-05-17Blackfin arch: Check for Anomaly 05000182Michael Hennerich
IMDMA does not operate to full speed for 600MHz and higher devices Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-04-25[Blackfin] arch: fix bug - before assign new channel to the map register, ↵Graf Yang
need clear the bits first. http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=2445 Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-04-25[Blackfin] arch: add Blackfin on-chip SIR IrDA driver supportGraf Yang
- add platform device resources in board files - add new bfin_sir.h to each machines Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-04-24[Blackfin] arch: Give the DMA base registers a more descriptive nameBernd Schmidt
The DMA base registers are available in a global named "base_addr" for every Blackfin variant. Give this a more descriptive name, and remove duplicate tables from some drivers. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-02-25[Blackfin] arch: Fix bug - Setting peripheral_map only when dma channel is ↵Sonic Zhang
UART2/3. Singed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-02-02[Blackfin] arch: Enable UART2 and UART3 for bf548Sonic Zhang
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22[Blackfin] arch: set_bfin_dma_config shouldnt set SYNC or RESTART by default ↵Michael Hennerich
- add argument or option Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21Blackfin arch: export symbol get_dma_curr_desc_ptr for driver usageCliff Cai
Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-22Blackfin arch: dma add some API and cleanup bf54x DMA definitionBryan Wu
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-10Blackfin arch: flush/inv the correct range when using write back cache and ↵Michael Hennerich
fix bugs find by dmacopy - flush/inv the correct range - dmacopy test failed when policy is write_back - invalidate before dma http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3367 It's the cache invalidate what is causing the issue. There is no invalidate only instruction it's always: FLUSHINV So when we "invalidate" after the DMA we might (do) overwrite freshly dma'ed data by dirty Cache WB content. Fixed by moving the "invalidate" at the beginning of dma_memcpy. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-09Blackfin arch: modify the insX/outsX and dma_insX/dma_outsX to be compatible ↵Bryan Wu
with other archs Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-09-12Blackfin arch: cleanup IO and DMA_IO API function definitions according to ↵Bryan Wu
other arches Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-08-05Blackfin arch: Add DMA API to set curr descriptor addressSonic Zhang
This API is necessary for DMA descriptor array mode. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-08-03Blackfin arch: Add option to priorize DMA over CoreMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>