Commit graph

1079 commits

Author SHA1 Message Date
Mike Frysinger
532f07ca04 Blackfin: fix early_dma_memcpy() handling of busy channels
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-07-16 01:52:26 -04:00
Mike Frysinger
fb4b5d3a37 Blackfin: handle BF561 Core B memory regions better when SMP=n
Rather than assume Core B is always run with caches turned on, let people
load into any of the on-chip memory regions.  It is their business how the
SRAM/Cache regions are utilized, so don't prevent them from being able to
load into them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:24 -04:00
Jie Zhang
8399a74f61 Blackfin: fix miscompilation in lshrdi3
The code used in the Blackfin lshrdi3 utilizes gcc constructs.  However,
the structures declared don't line up with the code gcc generates, so
under certain optimizations, we get bad code and things crap out in fun
random ways.  So rather than trying to maintain different gcc definitions
ourselves, just use the ones available in gcclib.h.

URL: http://blackfin.uclinux.org/gf/tracker/5286
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:23 -04:00
Robin Getz
dc437b1b59 Blackfin: fix silent crash when no uClinux MTD filesystem exists
Since we need to relocate the attached filesystem with the uClinux MTD map
(to handle some anomalies), we need to know its real filesize.  If we boot
a kernel without a filesystem actually attached, we end up blindly reading
and copying garbage (since there is no magic value to detect validity).
Often times this results in an early crash and no output.  So add a few
basic sanity checks before operating on things to catch the majority of
cases.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:21 -04:00
Mike Frysinger
15627bd35c Blackfin: restore exception banner when dumping crash info
Previous unification code put the exception banner behind the "is oops"
logic when it should have been printed all the time.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:20 -04:00
Robin Getz
0e4edcf0b0 Blackfin: work around anomaly 05000281
Add missing anomaly workaround for anomaly 05000281 - we can't return to
instructions which cause hardware errors otherwise we trigger the error
again which means we go into an infinite loop of handling, returning, and
retriggering.  This work around confuses gdb when the error occurs as the
PC will seemed to have moved, so a better long term fix will need to be
figured out, but for now this is better than an infinite crash loop.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:19 -04:00
Graf Yang
976119bc5d Blackfin: update anomaly lists to match latest sheets/usage
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:17 -04:00
Mike Frysinger
b2dc0a0884 Blackfin: drop dead flash_probe call
There are no CONFIG_{BLK,CHR}_DEV_FLASH Kconfig options, and there is no
flash_probe() function, so not really sure what this code is all about.
Seems to be dead code that stretches way back to the start of the Blackfin
port.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:39:45 -04:00
Robin Getz
1997660cea Blackfin: cleanup code a bit with comments and defines
Improve the assembly with a few explanatory comments and use symbolic
defines rather than numeric values for bit positions.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:39:39 -04:00
Alexey Dobriyan
405f55712d headers: smp_lock.h redux
* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
  It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

  This will make hardirq.h inclusion cheaper for every PREEMPT=n config
  (which includes allmodconfig/allyesconfig, BTW)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-12 12:22:34 -07:00
Peter Zijlstra
c99e6efe1b sched: INIT_PREEMPT_COUNT
Pull the initial preempt_count value into a single
definition site.

Maintainers for: alpha, ia64 and m68k, please have a look,
your arch code is funny.

The header magic is a bit odd, but similar to the KERNEL_DS
one, CPP waits with expanding these macros until the
INIT_THREAD_INFO macro itself is expanded, which is in
arch/*/kernel/init_task.c where we've already included
sched.h so we're good.

Cc: tony.luck@intel.com
Cc: rth@twiddle.net
Cc: geert@linux-m68k.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-10 14:24:05 -07:00
Joe Perches
ad361c9884 Remove multiple KERN_ prefixes from printk formats
Commit 5fd29d6ccb ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.

<level> is now included in the output on each additional use.

Remove all uses of multiple KERN_<level>s in formats.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-08 10:30:03 -07:00
FUJITA Tomonori
42b86e06c7 Blackfin: fix dma-mapping build errors
The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
systems.  This is because we don't define dma_sync_sg_for_cpu at all, so
until the DMA asm-generic conversion/cleanup is done after the next
release, simply stub out the dma_sync_sg_for_{cpu,device} functions.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 22:31:00 -04:00
Mike Frysinger
5ecf3e03cd Blackfin: hook up new perf_counter_open syscall
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:47:40 -04:00
Yi Li
986d6c1e05 Blackfin: drop BF535-specific text for exception 0x2A (unaligned instruction)
We don't support the BF535 at all, and the exception 0x2A text specific to
it is pretty verbose and confusing (since the behavior is simply odd), so
punt it to keep the noise down.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:19 -04:00
Robin Getz
bd854c077e Blackfin: fix early crash when booting on wrong cpu
Make sure we process the kernel command line before poking the hardware,
so that we can process early printk.  This helps ensure that if you boot
a kernel configured for a different processor, something will be left in
the log buffer.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:17 -04:00
Mike Frysinger
3aca47c020 Blackfin: fix GPTMR0_CLOCKSOURCE dependency on BFIN_GPTIMERS
The GPTMR0_CLOCKSOURCE Kconfig option requires the gptimers framework, so
make sure it is selected when this option is enabled.

Reported-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:15 -04:00
Mike Frysinger
3a7f5b1605 Blackfin: drop unused ISP1760 port1_disable from board resources
The port1 disable stuff was dropped from the USB ISP1760, so update the
Blackfin boards accordingly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:13 -04:00
Graf Yang
ee48efb5dc Blackfin: bf526-ezbrd: handle different SDRAM chips
The BF526-EZBRD changed SDRAM chips between board revisions, so create a
timing table that can accommodate both.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:12 -04:00
Graf Yang
8f580f7c82 Blackfin: fix typo in TRAS define in mem_init.h header
We defined SDRAM_tRAS to TRAS_4, but then wrongly defined SDRAM_tRAS_num
to 3.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:10 -04:00
Mike Frysinger
fa48f84a8c Blackfin: unify memory map headers
Many aspects of the Blackfin memory map is exactly the same across all
variants.  Rather than copy and paste all of these duplicated values in
each header, unify all of these into the common Blackfin memory map header
file.  In the process, push down BF561 SMP specific stuff to the BF561
specific header to keep the noise down.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:07 -04:00
Robin Getz
985895bd8d Blackfin: stick the CPU name into boot image name
Rather than use "Linux" in the boot image name (as this is redundant --
the image type is already set to "linux"), use the CPU name.  This makes
it fairly obvious when a wrong image is accidentally booted.  Otherwise
there is no kernel output and you waste time scratching your head
wondering wtf just happened.

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:03 -04:00
Mike Frysinger
841a534367 Blackfin: update defconfigs
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:16:01 -04:00
Jie Zhang
41ba653f24 Blackfin: decouple unrelated cache settings to get exact behavior
The current cache options don't really represent the hardware features.
They end up setting different aspects of the hardware so that the end
result is to turn on/off the cache.  Unfortunately, when we hit cache
problems with the hardware, it's difficult to test different settings to
root cause the problem.  The current settings also don't cleanly allow for
different caching behaviors with different regions of memory.

So split the configure options such that they properly reflect the settings
that are applied to the hardware.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:59 -04:00
Philippe Gerum
7c039a90f0 Blackfin: update I-pipe patch level
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:58 -04:00
Philippe Gerum
5ba3b249c9 Blackfin: remove obsolete mcount support from I-pipe code
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:56 -04:00
Philippe Gerum
a40494a62a Blackfin: allow CONFIG_TICKSOURCE_GPTMR0 with interrupt pipeline
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:54 -04:00
Philippe Gerum
06ecc190f3 Blackfin: convert interrupt pipeline to irqflags
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:53 -04:00
Mike Frysinger
3d15f302d0 Blackfin: allow people to select BF51x-0.1 silicon rev
Now that 0.1 of the BF51x is coming out, allow people to build for it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:51 -04:00
Graf Yang
dc2c46bb70 Blackfin: bf526-ezbrd: set SPI flash resources to SST device
The BF526-EZBRD has a SST SPI flash on it, not a ST Micro.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:49 -04:00
Sonic Zhang
0de4adfb8c Blackfin: fix accidental reset in some boot modes
We read the SWRST (Software Reset) register to get at the last reset
state, and then we may configure the DOUBLE_FAULT bit to control behavior
when a double fault occurs.  But if the lower bits of the register is
already set (like UART boot mode on a BF54x), we inadvertently make the
system reset by writing to the SYSTEM_RESET field at the same time.  So
make sure the lower 4 bits are always cleared.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:48 -04:00
Mike Frysinger
81b79c213d Blackfin: abstract irq14 lowering in do_irq
Split out the optional IRQ14 lowering code to further simplify the
asm_do_IRQ() function and keep the ifdef nest under control.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:46 -04:00
Mike Frysinger
6f10fdabdc Blackfin: simplify irq stack overflow checking
Take a page from x86 and abstract the stack checking out of the
asm_do_IRQ() function so that the result is easier to digest.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:43 -04:00
Mike Frysinger
46f288a0f9 Blackfin: only build show_interrupts() when procfs is enabled
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:42 -04:00
Mike Frysinger
26579216f3 Blackfin: redo handling of bad irqs
With the common IRQ code initializing much more of the irq_desc state, we
can't blindly initialize it ourselves to the local bad_irq state.  If we
do, we end up wrongly clobbering many fields.  So punt most of the bad irq
code as the common layers will handle the default state, and simply call
handle_bad_irq() directly when the IRQ we are processing is invalid.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:40 -04:00
Mike Frysinger
a200ad22bb Blackfin: update anomaly lists
Update anomaly headers to match latest released anomaly sheets.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:38 -04:00
Mike Frysinger
4d5e6fd42c Blackfin: bf533-ezkit: add resources for FISP devices
The BF533-EZKIT has two Flash In-System Programming devices hooked up to
the async memory bus, so add resources for the primary flashes and the
SRAMs on the devices.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:37 -04:00
Mike Frysinger
2780cd6434 Blackfin: bf518f-ezbrd: update DSA resources
The common DSA code changed structure layout, so update the BF518F-EZBRD
resources accordingly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:36 -04:00
Mike Frysinger
e56e03b0cf Blackfin: unify memory region checks between kgdb and traps
The kgdb (in multiple places) and traps code developed pretty much
identical checks for how to access different regions of the Blackfin
memory map, but each wasn't 100%, so unify them to avoid duplication,
bitrot, and bugs with edge cases.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-22 21:15:34 -04:00
Mike Frysinger
eec511d75e Blackfin: convert page/tlb to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:42:30 -04:00
Mike Frysinger
0f65285957 Blackfin: convert types to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:42:24 -04:00
Mike Frysinger
d5ce528c8e Blackfin: convert irq/process to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:56 -04:00
Mike Frysinger
415f92da75 Blackfin: convert signal/mmap to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:26 -04:00
Mike Frysinger
3d15063093 Blackfin: convert locking primitives to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:22 -04:00
Mike Frysinger
22a151c1bc Blackfin: convert termios to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:17 -04:00
Mike Frysinger
094167be1f Blackfin: convert simple headers to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:13 -04:00
Mike Frysinger
3be5646c98 Blackfin: convert socket/poll to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:08 -04:00
Mike Frysinger
420b61f4a7 Blackfin: convert user/elf to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:41:03 -04:00
Mike Frysinger
71b844f163 Blackfin: convert shm/sysv/ipc to asm-generic
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:40:58 -04:00
Mike Frysinger
83dab40350 Blackfin: convert asm/ioctls.h to asm-generic/ioctls.h
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:40:53 -04:00