summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Blackfin: convert DMA mutex to an atomic and drop redundant codeMike Frysinger2009-12-151-21/+10Star
| | | | | | | | | | | 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>
* Blackfin: push down asm/ includes and out of bfin-global.hMike Frysinger2009-12-151-0/+1
| | | | | | | Avoid including unnecessary headers all the time as well as circular includes with core requirements. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: bf538: add support for extended GPIO banksMichael Hennerich2009-12-151-0/+97
| | | | | | | | | | | The GPIOs on ports C/D/E on the BF538/BF539 do not behave the same way as the other ports on the part and the same way as all other Blackfin parts. The MMRs are programmed slightly different and they cannot be used to generate interrupts or wakeup a sleeping system. Since these guys don't fit into the existing code, create a simple gpiolib driver for them. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: calculate on-chip lengths at link time rather than run timeMike Frysinger2009-12-152-35/+32Star
| | | | | | | Since the link sizes never change at runtime, push the calculation out to the linker script to save some useless calculation costs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: improve async bank access checking (for cross-banks & XIP)Bernd Schmidt2009-12-151-15/+62
| | | | | | | | | | | The access_ok() function did not accept ranges within the async banks which made it impossible to do XIP in flash. Fixing that also showed that the current bfin_mem_access_type() code did not work with accesses that spanned async banks (like a file system). So split out and fix the async bank checks so that all these scenarios work as expected. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: convert DMA code to a proper bitmapMichael Hennerich2009-12-151-7/+8
| | | | | | | | | Rather than using our own data structures that basically boil down to a bitmap, use the standard bitmap functions. Reported-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: add some bounds checking to peripheral_requestBarry Song2009-12-151-0/+2
| | | | | | | | | | | The requested peripheral is turned into an index into some state arrays, so make sure the calculated index doesn't exceed the index. This occurs when using bogus pin values or the define headers are screwed up. Now we'll notice right away that something needs fixing instead of trying to track down random memory corruption. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: use common code for cycle->nanosecond conversionYi Li2009-12-151-22/+4Star
| | | | | | | | No point in redefining things that common code already does for us. Also use CYC2NS_SCALE_FACTOR to better reflect reality and for better precision. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: unify sched_clock() handling between clock sourcesYi Li2009-12-151-10/+33
| | | | | | | | | | Currently sched_clock() is only defined when using CYCLES as a clock source. Declare sched_clock() in common code and mark it with notrace to prevent invoking sched_clock() recursively (because ftrace uses sched_clock() to record time). Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix gptimer0 clock source compile warningYi Li2009-12-151-1/+1
| | | | | | | | | Some of the clocksource prototypes were updated, but the gptimer0 func was missed in the process. Not a big issue as the argument is ignored, but we should fix the compile warning anyways. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Unify sys_mmap*Al Viro2009-12-111-33/+0Star
| | | | | | | New helper - sys_mmap_pgoff(); switch syscalls to using it. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of ↵Linus Torvalds2009-12-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits) tree-wide: fix misspelling of "definition" in comments reiserfs: fix misspelling of "journaled" doc: Fix a typo in slub.txt. inotify: remove superfluous return code check hdlc: spelling fix in find_pvc() comment doc: fix regulator docs cut-and-pasteism mtd: Fix comment in Kconfig doc: Fix IRQ chip docs tree-wide: fix assorted typos all over the place drivers/ata/libata-sff.c: comment spelling fixes fix typos/grammos in Documentation/edac.txt sysctl: add missing comments fs/debugfs/inode.c: fix comment typos sgivwfb: Make use of ARRAY_SIZE. sky2: fix sky2_link_down copy/paste comment error tree-wide: fix typos "couter" -> "counter" tree-wide: fix typos "offest" -> "offset" fix kerneldoc for set_irq_msi() spidev: fix double "of of" in comment comment typo fix: sybsystem -> subsystem ...
| * Merge branch 'for-next' into for-linusJiri Kosina2009-12-071-1/+1
| |\ | | | | | | | | | | | | | | | Conflicts: kernel/irq/chip.c
| | * tree-wide: fix assorted typos all over the placeAndré Goddard Rosa2009-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'bkl-arch-for-linus' of ↵Linus Torvalds2009-12-091-5/+1Star
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'bkl-arch-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: mn10300: Remove the BKL from sys_execve m68knommu: Remove the BKL from sys_execve m68k: Remove the BKL from sys_execve h83000: Remove BKL from sys_execve frv: Remove the BKL from sys_execve blackfin: Remove the BKL from sys_execve um: Remove BKL from mmapper um: Remove BKL from random s390: Remove BKL from prng
| * | blackfin: Remove the BKL from sys_execveJohn Kacur2009-10-141-5/+1Star
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This looks like a cut-and-paste job. For example, compare this function to sys_execve in arch/x86/kernel/process_64.c and it is almost line by line the same, except the one in x86 nolonger has the big kernel lock. All of the functions called between the lock are generic and not specific to blackfin - thus, I believe it is safe to remove the bkl here. Signed-off-by: John Kacur <jkacur@redhat.com> Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> LKML-Reference: <alpine.LFD.2.00.0910130007240.3658@localhost.localdomain> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | Blackfin: fix SMP build error in start_thread()Graf Yang2009-11-251-1/+1
| | | | | | | | | | | | | | | | | | Commit d5ce528c8e46fa5afb9 (Blackfin: convert irq/process to asm-generic) incorrectly merged the smp and non-smp cases of start_thread() causing the L1 stack to be setup on the SMP port instead of the UP port. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Blackfin: fix typo in ptrace pokingJie Zhang2009-11-251-1/+1
| | | | | | | | | | | | | | | | | | Commit c014e15a2f667f9 (Blackfin: convert ptrace to new memory functions) introduced a copy & paste typo in the ptrace poke data/text handling. The access_process_vm() function call was telling it to read instead of write. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Blackfin: fix cache Kconfig typoAndré Goddard Rosa2009-11-251-1/+1
| | | | | | | | | | | | | | The Kconfig option is "BFIN_EXTMEM_WRITETHROUGH", not "..._WRITETROUGH". Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Blackfin: fix suspend/resume failure with some on-chip ROMsMichael Hennerich2009-11-251-2/+7
|/ | | | | | | | | | | 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>
* headers: remove sched.h from interrupt.hAlexey Dobriyan2009-10-111-0/+1
| | | | | | | | After m68k's task_thread_info() doesn't refer to current, it's possible to remove sched.h from interrupt.h and not break m68k! Many thanks to Heiko Carstens for allowing this. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
* Blackfin: fix framebuffer mmap bug for nommuThomas Chou2009-10-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch added a special get_unmapped_area for framebuffer which was hooked to the file ops in drivers/video/fbmem.c. This is needed since v2.6.29-rc1 where nommu vma management was updated, and mmap of framebuffer caused kernel BUG panic. You may turn on "Debug the global anon/private NOMMU mapping region tree" config to such message. As Documentation/nommu-mmap.txt said, "To provide shareable character device support, a driver must provide a file->f_op->get_unmapped_area() operation. The mmap() routines will call this to get a proposed address for the mapping." With this change, user space should call mmap for framebuffer using shared map. Or it can try shared map first, then private map if failed. This shared map usage is now consistent between mmu and nommu. The sys_ file may not be a good place for this patch. But there is a similar one for sparc. I tested a similar patch on nios2nommu, though I don't have a blackfin board to test. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: cplbinfo: drop d_path() hacksMike Frysinger2009-10-071-13/+12Star
| | | | | | | | | | | The cplbinfo was using d_path() to figure out which cpu/cplb was being parsed. As Al pointed out, this isn't exactly reliable as it assumes the static VFS path to be unchanged, and it's just poor form. So use the proc_create_data() to properly (and internally) pass the exact cpu/cplb requested to the parser function. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: mass clean up of copyright/licensing infoRobin Getz2009-10-0725-432/+63Star
| | | | | | | | | | | | | | | | | | 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>
* Blackfin: convert to use arch_gettimeoffset()john stultz2009-10-071-61/+2Star
| | | | | | | | | | | | | | | Convert Blackfin to use GENERIC_TIME via the arch_getoffset() infrastructure, reducing the amount of arch specific code we need to maintain. I've taken my best swing at converting this, but I'm not 100% confident I got it right. My cross-compiler is now out of date (gcc4.2) so I wasn't able to check if it compiled. Any assistance from arch maintainers or testers to get this merged would be great. Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* blackfin: Cleanup linker script using new linker script macros.Tim Abbott2009-09-251-50/+6Star
| | | | | | | | | Signed-off-by: Tim Abbott <tabbott@ksplice.com> Cc: Bryan Wu <cooloney@kernel.org> Cc: uclinux-dist-devel@blackfin.uclinux.org Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Blackfin: update ftrace for latest toolchainYi Li2009-09-171-11/+12
| | | | | | | | | | | | The mcount support that was finally added to the Blackfin gcc port isn't exactly the same as what ftrace was developed against. Now that the final gcc version is in place, update the ftrace code to match. While updating this, fix the swapped arguments to the tracer (signature is (ip, parent_ip) while we were passing (parent_ip, ip)). Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: unify cache init functionsMike Frysinger2009-09-174-144/+2Star
| | | | | | | | The CPLB implementations (mpu/nompu) had exact copies of the cacheinit code. Even the i/d cache functions are largely the same. So unify them both in the common kernel cache code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: swap clocksource ratings for gptimer/cyclesGraf Yang2009-09-171-2/+2
| | | | | | | | The cycles clocksource is a higher resolution than the gptimer one, so make sure the ratings field reflects this. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: update ftrace_push_return_trace() breakageMike Frysinger2009-09-171-1/+1
| | | | | | | | Commit 71e308a239c updated ftrace_push_return_trace() prototype but didn't update the Blackfin ftrace code, so things broke. Since we don't support the new stuff yet, call it with stub values. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: add ICPLB coverage for async banksBernd Schmidt2009-09-171-2/+9
| | | | | | | | When doing XIP, we need to execute out of the async banks, so we need ICPLBs to allow this. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: use KERN_ALERT in all kgdb_test outputMingquan Pan2009-09-171-1/+1
| | | | | | | | Most messages are already using KERN_ALERT, so be consistent to make things easier to check with test scripts. Signed-off-by: Mingquan Pan <grace.pan@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix spelling in a few commentsMichael Hennerich2009-09-171-2/+2
| | | | | Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: use raw_smp_processor_id() in exception codeYi Li2009-09-173-8/+8
| | | | | | | | | | | When preempt debugging is enabled, smp_processor_id() may utilize the "current" structure. This may not be safe to access under all exceptions due to it being in dynamically allocated memory. So in exception code, make sure we use raw_smp_processor_id() instead to get at the real value directly. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: remove useless duplicated assignment in gpio codeMichael Hennerich2009-09-171-1/+0Star
| | | | | Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: Fix link errors with binutils 2.19 and GCC 4.3Ingo Molnar2009-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | | Not sure whether this has been reported/fixed before. Today I built a Blackfin tool-chain from scratch for -tip testing, and it triggers: arch/blackfin/kernel/vmlinux.lds:1238: undefined section `.data_a_l1' referenced in expression and: arch/blackfin/kernel/vmlinux.lds:1238: undefined section `.text_data_l1' referenced in expression Now i dont have any way to test this linker script, but it now at least builds fine after fixing what appears to be typos in those assert statements. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: optimize fixed code handling for the most common caseMike Frysinger2009-09-171-8/+2Star
| | | | | | | | | | | The majority of the time we are returning to user space, it is not in the fixed atomic code region. So rather than branch to a function where we check the PC and return, do the check inline and branch only when needed. Also, tweak some of the fixed code handling based on assumptions we are aware of but cannot be expressed in C. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: punt dead cache locking codeMike Frysinger2009-09-171-51/+0Star
| | | | | | | No one uses these functions, and some are duplicate of existing C code. So just punt the whole thing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: do not trace the exception handlerYi Li2009-09-171-1/+1
| | | | | | | | Since the exception handler cannot cause exceptions, we cannot trace it without easily causing double faults and crashing the system. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: cleanup sync handling when enabling/disabling cplbsYi Li2009-09-174-83/+23Star
| | | | | | | | | | | | | | The handling of updating the [DI]MEM_CONTROL MMRs does not follow proper sync procedures as laid out in the Blackfin programming manual. So rather than audit/fix every call location, create helper functions that do the right things in order to safely update these MMRs. Then convert all call sites to use these new helper functions. While we're fixing the code, drop the workaround for anomaly 05000125 as that anomaly applies to old versions of silicon that we do not support. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix read buffer overflowRoel Kluin2009-09-171-4/+4
| | | | | | | 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>
* Blackfin: improve double fault debug handlingGraf Yang2009-09-172-4/+10
| | | | | | | | | | | | | | Since the hardware only provides reporting for the last exception handled, and the values are valid only when executing the exception handler, we need to save the context for reporting at a later point. While we do this for one exception, it doesn't work properly when handling a second one as the original exception is clobbered by the double fault. So when double fault debugging is enabled, create a dedicated shadow of these values and save/restore out of there. Now the crash report properly displays the first exception as well as the second one. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix MPU handling of invalid memory accessesGraf Yang2009-09-171-1/+1
| | | | | | | | | | | | The protect_page() function was incorrectly setting up the hardware tables based on possible access capabilities rather than the actual requested values. This means we would grant more access to mmap-ed pages than we should have. Once we fix this, we need to tweak the signal generated by such accesses to aline ourselves with other ports. This allows the LTP mmap0{5,6,7} cases to run properly. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: do not try displaying the end of the stackSonic Zhang2009-09-171-1/+1
| | | | | | | | | The end of the stack may not be valid (and that could be OK), so do not attempt to parse it. If we do, we might use a bad pointer in kernel space which makes things panic(). Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: catch hardware errors earlier during bootingRobin Getz2009-09-174-12/+122
| | | | | | | | | | | | | | | | | | 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>
* Blackfin: add an early shadow consoleRobin Getz2009-09-173-0/+81
| | | | | | | | | Add a memory based shadow console to keep a copy of the printk buffer in a location which can be found externally. This allows bootloaders to locate and utilize the log buffer in case of silent (early/resume/etc...) crashes. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: add support for common FDPIC ptrace requestsMike Frysinger2009-09-171-2/+24
| | | | | | | | The FDPIC arches support a standard set of ptrace requests so rather than define our own custom API, hook up those requests for common code to leverage. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: clean up early memory setup codeRobin Getz2009-09-171-28/+32
| | | | | | | | Remove code duplication, and only print out memory warnings when they are an actual problem. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix module reloc handling for all memory regionsMike Frysinger2009-09-171-28/+34
| | | | | | | | | The current module relocation code has spotty handling wrt different memory regions (like L1 instruction). Rather than try to fix each little spot, use the new common memory functions to greatly simplify everything and make sure it is always correct. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: cleanup module section checkingMike Frysinger2009-09-171-51/+60
| | | | | | | | | The current module section handling code has a lot of verbose statements copied and pasted throughout which makes it pretty hard to digest at a glance. By unifying all of these up front, it is a lot easier to quickly get an idea of what is actually going on. Signed-off-by: Mike Frysinger <vapier@gentoo.org>