summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
Commit message (Collapse)AuthorAgeFilesLines
* NOMMU: Make VMAs per MM as for MMU-mode linuxDavid Howells2009-01-082-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make VMAs per mm_struct as for MMU-mode linux. This solves two problems: (1) In SYSV SHM where nattch for a segment does not reflect the number of shmat's (and forks) done. (2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an exec'ing process when VM_EXECUTABLE is specified, regardless of the fact that a VMA might be shared and already have its vm_mm assigned to another process or a dead process. A new struct (vm_region) is introduced to track a mapped region and to remember the circumstances under which it may be shared and the vm_list_struct structure is discarded as it's no longer required. This patch makes the following additional changes: (1) Regions are now allocated with alloc_pages() rather than kmalloc() and with no recourse to __GFP_COMP, so the pages are not composite. Instead, each page has a reference on it held by the region. Anything else that is interested in such a page will have to get a reference on it to retain it. When the pages are released due to unmapping, each page is passed to put_page() and will be freed when the page usage count reaches zero. (2) Excess pages are trimmed after an allocation as the allocation must be made as a power-of-2 quantity of pages. (3) VMAs are added to the parent MM's R/B tree and mmap lists. As an MM may end up with overlapping VMAs within the tree, the VMA struct address is appended to the sort key. (4) Non-anonymous VMAs are now added to the backing inode's prio list. (5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of the backing region. The VMA and region structs will be split if necessary. (6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory segment instead of all the attachments at that addresss. Multiple shmat()'s return the same address under NOMMU-mode instead of different virtual addresses as under MMU-mode. (7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode. (8) /proc/maps is now the global list of mapped regions, and may list bits that aren't actually mapped anywhere. (9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount of RAM currently allocated by mmap to hold mappable regions that can't be mapped directly. These are copies of the backing device or file if not anonymous. These changes make NOMMU mode more similar to MMU mode. The downside is that NOMMU mode requires some extra memory to track things over NOMMU without this patch (VMAs are no longer shared, and there are now region structs). Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Mike Frysinger <vapier.adi@gmail.com> Acked-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2009-01-0734-3018/+2297
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (171 commits) Blackfin arch: fix bug - BF527 0.2 silicon has different CPUID (DSPID) value Blackfin arch: Enlarge flash partition for kenel for bf533/bf537 boards Blackfin arch: fix bug: kernel crash when enable SDIO host driver Blackfin arch: Print FP at level KERN_NOTICE Blackfin arch: drop ad73311 test code Blackfin arch: update board default configs Blackfin arch: Set PB4 as the default irq for bf548 board v1.4+. Blackfin arch: fix typo in early printk bit size processing Blackfin arch: enable reprogram cclk and sclk for bf518f-ezbrd Blackfin arch: add SDIO host driver platform data Blackfin arch: fix bug - kernel stops at initial console Blackfin arch: fix bug - kernel crash after config IP for ethernet port Blackfin arch: add sdh support for bf518f-ezbrd Blackfin arch: fix bug - kernel detects BF532 incorrectly Blackfin arch: add () to avoid warnings from gcc Blackfin arch: change HWTRACE Kconfig and set it on default Blackfin arch: Clean oprofile build path for blackfin Blackfin arch: remove hardware PM code, oprofile not use it Blackfin arch: rewrite get_sclk()/get_vco() Blackfin arch: cleanup and unify the ins functions ...
| * Blackfin arch: Print FP at level KERN_NOTICEJie Zhang2009-01-071-1/+1
| | | | | | | | | | | | Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: fix typo in early printk bit size processingMike Frysinger2009-01-071-2/+2
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: rewrite get_sclk()/get_vco()Mike Frysinger2009-01-071-15/+16
| | | | | | | | | | | | | | | | | | rewrite get_sclk()/get_vco() based on the assumption sclk/vco never changes (since today it cannot) Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: merge adeos blackfin part to arch/blackfin/Yi Li2009-01-0710-66/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Mike Frysinger <vapier.adi@gmail.com>: - handle bf531/bf532/bf534/bf536 variants in ipipe.h - cleanup IPIPE logic for bfin_set_irq_handler() - cleanup ipipe asm code a bit and add missing ENDPROC() - simplify IPIPE code in trap_c - unify some of the IPIPE code and fix style - simplify DO_IRQ_L1 handling with ipipe code - revert IRQ_SW_INT# addition from ipipe merge - remove duplicate get_{c,s}clk() prototypes ] Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: merge kgdb test code using common CONFIG_KGDB_TESTSMike Frysinger2009-01-072-0/+124
| | | | | | | | | | | | | | | | | | [Grace Pan <grace.pan@analog.com>: Add case for kgdb test in l1 and l2] Signed-off-by: Grace Pan <grace.pan@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Faster C implementation of no-MPU CPLB handlerBernd Schmidt2009-01-0711-1276/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a mixture ofcMichael McTernan's patch and the existing cplb-mpu code. We ditch the old cplb-nompu implementation, which is a good example of why a good algorithm in a HLL is preferrable to a bad algorithm written in assembly. Rather than try to construct a table of all posible CPLBs and search it, we just create a (smaller) table of memory regions and their attributes. Some of the data structures are now unified for both the mpu and nompu cases. A lot of needless complexity in cplbinit.c is removed. Further optimizations: * compile cplbmgr.c with a lot of -ffixed-reg options, and omit saving these registers on the stack when entering a CPLB exception. * lose cli/nop/nop/sti sequences for some workarounds - these don't * make sense in an exception context Additional code unification should be possible after this. [Mike Frysinger <vapier.adi@gmail.com>: - convert CPP if statements to C if statements - remove redundant statements - use a do...while loop rather than a for loop to get slightly better optimization and to avoid gcc "may be used uninitialized" warnings ... we know that the [id]cplb_nr_bounds variables will never be 0, so this is OK - the no-mpu code was the last user of MAX_MEM_SIZE and with that rewritten, we can punt it - add some BUG_ON() checks to make sure we dont overflow the small cplb_bounds array - add i/d cplb entries for the bootrom because there is functions/data in there we want to access - we do not need a NULL trailing entry as any time we access the bounds arrays, we use the nr_bounds variable ] Signed-off-by: Michael McTernan <mmcternan@airvana.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: panic when running on a chip rev below what we are compiled forRobin Getz2009-01-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | If we are running on a chip revision below what we are compiled for, there will be missing anomaly workarounds, and a panic is inevitable. Do is sooner, rather than later, so people don't look for bugs that already have workarounds (that they turned off). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: do not allow people to pass in a diff clkin_hz valueMike Frysinger2009-01-071-0/+4
| | | | | | | | | | | | | | | | | | do not allow people to pass in a diff clkin_hz value when reprogramming clocks -- it is too late currently Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: allow clkin_hz to be specified on the command lineMike Frysinger2009-01-071-3/+21
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: show_cpuinfo - consolidate ugly castsMike Frysinger2009-01-071-11/+8
| | | | | | | | | | | | | | | | | | rather than use *(unsigned int *)v everywhere, do this once with a local cpu_num variable Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: add __init markings to Blackfin timer init functionsMike Frysinger2009-01-071-3/+3
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: push cache flushing up to dma_memcpyMike Frysinger2009-01-071-11/+14
| | | | | | | | | | | | | | | | | | 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>
| * Blackfin arch: request_dma() returns 0 on success, not channelMike Frysinger2009-01-071-1/+1
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: move most dma functions into static inlinesMike Frysinger2009-01-071-212/+21
| | | | | | | | | | | | | | | | | | 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>
| * Blackfin arch: set_dma_callback: do not store .irqMike Frysinger2009-01-071-11/+9
| | | | | | | | | | | | | | | | | | 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>
| * Blackfin arch: drop irq_callback from struct dma_channelMike Frysinger2009-01-071-3/+2
| | | | | | | | | | | | | | | | 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>
| * Blackfin arch: drop custom dma_interrupt_t and just use irq_handler_tMike Frysinger2009-01-071-1/+1
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: include linux/mm.h since we use PAGE_ALIGN and suchMike Frysinger2009-01-071-0/+1
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: rewrite dma_memcpy() and dma in/out functionsMike Frysinger2009-01-072-366/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * Blackfin arch: check pointers in safe_dma_memcpyMike Frysinger2009-01-071-3/+10
| | | | | | | | | | | | | | | | 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>
| * Blackfin arch: push bf561 PERIPHERAL_MAP oddity into bf561-specific codeMike Frysinger2009-01-071-11/+5
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Add basic irq stack checking for BlackfinRobin Getz2009-01-071-1/+15
| | | | | | | | | | | | Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: dma_memcpy() - do not return NULL when transferring a ↵Mike Frysinger2009-01-071-2/+2
| | | | | | | | | | | | | | | | multiple of 65k Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: remove #if check on L2_LENGTHMike Frysinger2009-01-071-5/+1
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: rename MAX_BLACKFIN_DMA_CHANNEL to MAX_DMA_CHANNELS to match ↵Mike Frysinger2009-01-071-7/+7
| | | | | | | | | | | | | | | | everyone else Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: add const to some function prototype and struct dma_channelMichael McTernan2009-01-071-1/+1
| | | | | | | | | | | | | | 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>
| * Blackfin arch: implement support for /proc/dmaGraf Yang2009-01-071-4/+40
| | | | | | | | | | | | Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: smp patch cleanup from LKML reviewGraf Yang2009-01-075-0/+6
| | | | | | | | | | | | | | | | | | 1. Use inline get_l1_... functions instead of macro 2. Fix compile issue about smp barrier functions Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: fix bugs in linker script when using upstream binutilsBernd Schmidt2009-01-071-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a few problems I discovered when building a kernel with upstream CVS binutils. We have to add the NOTES macro to our linker script, since a kernel built with --build-id is otherwise unable to boot. Last time NOTES was added, it broke things, but the definition of the macro has changed not to rely on parts of the linker script that aren't present on Blackfin. I also noticed that _l2_lma_start does not point into the kernel image, but rather somewhere in L1/L2 space, which seems unintended. Also, when the L2 section was added to the linker script, the part following it which computes then length of the init section was not updated. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Remove all traces of the relocation stackBernd Schmidt2009-01-071-132/+7
| | | | | | | | | | | | | | | | | | | | | | | | Remove all traces of the relocation stack. It's been removed from binutils for years now. Add a sanity overflow check to pcrel24 relocations to catch modules that were built without -mlong-calls. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: tweak the BUG_ON() check to allow for equal valuesMike Frysinger2009-01-071-4/+4
| | | | | | | | | | | | | | | | | | Tweak the BUG_ON() check to allow for equal values since the way pos is handled ... it is always indexed and post incremented Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: rewrite cplbinfo to use seq filesMike Frysinger2009-01-071-125/+191
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Allow a gpio pin be requested both as gpio and irq.Graf Yang2009-01-071-6/+76
| | | | | | | | | | | | | | | | | | | | | | | | [Mike Frysinger <vapier.adi@gmail.com>: - use KERN_NOTICE when using gpios as both irq and non rather than KERN_ERR - embedded newlines in printk() does not fly] Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: delete now unused "cclk" member of blackfin_cpudataMike Frysinger2009-01-071-1/+0
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Fix bug - change cpufreq doesn't take effect on bf537 nowMichael Hennerich2008-11-181-3/+4
| | | | | | | | | | | | | | | | CCLK is variable: get current CCLK in show_cpuinfo Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: Request the gpio resource when making it as an irq pin, ↵Graf Yang2008-11-181-2/+2
| | | | | | | | | | | | | | | | avoiding override it. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: add BUG_ON() checks to make sure we dont overflow the cplb tablesMike Frysinger2008-11-181-1/+10
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: noMMU CPLB lookup tables can be in L1 SRAMMike Frysinger2008-11-182-10/+10
| | | | | | | | | | | | | | | | | | | | - unify duplicate page_size_table definitions - make sure it is placed alongside the other cplb switching code Pointed-out-by: Michael McTernan <mmcternan@airvana.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: do not include init sections in the kernel lock down as it ↵Mike Frysinger2008-11-181-1/+1
| | | | | | | | | | | | | | | | gets released afterwards Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: change return valueMike Frysinger2008-11-181-12/+6
| | | | | | | | | | | | | | | | | | change return of close_cplbtab() and fill_cplbtab() to void since we always return 0 and nowhere do we check this Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: remove pointless define IN_KERNELMike Frysinger2008-11-181-4/+4
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: unify cplbinfo filesMike Frysinger2008-11-186-363/+201
| | | | | | | | | | | | | | | | Merge MPU and noMPU version of CPLB info code to one common version. Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: remove BFIN_DMA_5XX optionMike Frysinger2008-11-181-2/+1
| | | | | | | | | | | | | | | | | | Do not make BFIN_DMA_5XX optional since a large portion of our code relies on dma functions existing Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: cleanup the time.c codeMike Frysinger2008-11-181-65/+36
| | | | | | | | | | | | | | | | | | - make the code a bit more readable - kill of warnings/ifdef mess a bit Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: do not define decode_instruction if hwtrace is turned offMike Frysinger2008-11-181-2/+2
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: move out irq related functionsMike Frysinger2008-11-181-1/+0
| | | | | | | | | | | | | | | | move irq related functions into asm/irq.h and out of the mondo asm/system.h Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: introduce an IM_MEM macro to kgdbMike Frysinger2008-11-181-70/+35
| | | | | | | | | | | | | | | | | | create an IN_MEM() macro to simplify comparing an address in an on-chip region of memory and make things readable Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
| * Blackfin arch: fix off-by-one errors on end of memory rangeMike Frysinger2008-11-181-4/+4
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
OpenPOWER on IntegriCloud