Commit Graph

1598 Commits

Author SHA1 Message Date
Barry Song 706a01b1c6 Blackfin: bf537-stamp: add CAN resources
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:38 -05:00
Michael Hennerich 1f13f2fdca Blackfin: bf537-stamp: add AD5258 i2c address
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:35 -05:00
Cliff Cai 04267638e0 Blackfin: bf537-stamp: add adau1761 i2c address
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:32 -05:00
Cliff Cai d53127ffd6 Blackfin: bf537-stamp: add adau1371 i2c address
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:31 -05:00
Michael Hennerich 78756c6230 Blackfin: bf537-stamp: add ADP8870 resources
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:29 -05:00
Mike Frysinger 5b7c57751e Blackfin: bf537-stamp: kill AD714x board-specific Kconfigs
Include the AD714x SPI/I2C resources based on what is possible.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:25 -05:00
Michael Hennerich 1d23dc89f2 Blackfin: bf537-stamp: update ADP5520 resources
Matches feedback for driver changes.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:23 -05:00
Michael Hennerich 5db4036b46 Blackfin: bf537-stamp: add ADXL346 orientation sensing support
The ADXL34x driver was updated to include orientation sensing, so have the
bf537-stamp use it by default.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:20 -05:00
Michael Hennerich 57af8edf3f Blackfin: bf537-stamp/bf548-ezkit: update ADXL34x resources
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:18 -05:00
Mike Frysinger 31ad0e27ed Blackfin: BF51x: unify def/cdef headers
Whole lot of duplicated code here just went bye bye.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:16 -05:00
Mike Frysinger b1740549d4 Blackfin: BF52x: unify def/cdef headers
Whole lot of duplicated code here just went bye bye.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:13 -05:00
Mike Frysinger 7eb87fd3f1 Blackfin: BF537: push down error masks to avoid namespace pollution
The error masks are only needed in the BF537 demux error code, so instead
of needing all the short peripheral defines in global space, push these
masks into the one file where they are actually needed.  This fixes a
bunch of define collisions with common code (can/serial/etc...).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Barry Song <barry.song@analog.com>
2009-12-15 00:16:11 -05:00
Yi Li 578d36f5e1 Blackfin: SMP: don't start up core b until its state has been completely onlined
When testing PREEMPT_RT kernel on BF561-EZKit, the kernel blocks while
booting.  When the kernel initializes the ethernet driver, it sleeps and
never wakes up.

The issue happens when the kernel waits for a timer for Core B to timeout
(the timers are per-cpu based: static DEFINE_PER_CPU(struct tvec_base *,
tvec_bases) = &boot_tvec_bases).

However, the ksoftirqd thread for Core B (note, the ksoftirqd thread is
also per-cpu based) cannot work properly, and the timers for Core B never
times out.

When ksoftirqd() for the first time runs on core B, it is possible core A
is still initializing core B (see smp_init() -> cpu_up() -> __cpu_up()).
So the "cpu_is_offline()" check may return true and ksoftirqd moves to
"wait_to_die".

So delay the core b start up until the per-cpu timers have been set up
fully.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:09 -05:00
Barry Song ad774b7cb0 Blackfin: convert to asm-generic pci headers
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:07 -05:00
Mike Frysinger 2d40292b5a Blackfin: io.h: fix random busted whitespace
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:04 -05:00
Barry Song dd3b0e3e6a Blackfin: dma-mapping.h: flesh out missing DMA mapping functions
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:16:01 -05:00
Barry Song a00b4fe5ce Blackfin: workaround anomaly 05000310
While fetching instructions at the boundary of L1 instruction SRAM, a false
External Memory Addressing Error might be triggered.  We should ignore this
and continue on our way to avoid random crashes.

Because hardware errors are not exact in the Blackfin architecture, we need
to catch a few more common cases when the code flow changes and the signal
is finally delivered.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:59 -05:00
Mike Frysinger 340a1be1ee Blackfin: drop ptrace() write support for fixed code/bootrom
These regions are either read-only and won't work anyways (bootrom), or
we don't want people screwing with them because they're shared between
all processes (fixed code).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:57 -05:00
Barry Song e187837b6f Blackfin: MPU: support XIP in async flash memory
The NOMPU code already supported executing in the async banks, so this
brings the MPU code in line.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:54 -05:00
Barry Song d45e8db1b2 Blackfin: drop 4KB reserve at end of memory
The point of this small chunk was to avoid anomaly 05000310.  This never
really seemed to do what it was intended though -- no valid CPLBs exist
over the reserved memory, and there is often memory before it anyways (due
to the uClinux MTD and/or reserved DMA region).  Plus, it doesn't address
the L1 instruction case.

So drop this chunk as it wastes memory and is affront to humanity.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:50 -05:00
Barry Song c45c06596e Blackfin: support smaller uncached DMA chunks for memory constrained systems
When working with 8 meg systems, forcing a 1 meg DMA chunk heavily cuts
into the available resources.  So support smaller chunks to better cover
needs for these systems.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:48 -05:00
Mike Frysinger 5df326aca4 Blackfin: push BF5Xx configs down into mach-specific Kconfigs
While we're moving the BF54x code, have the BF54xM variants select the
normal BF54x values so that the rest of the Kconfig tree doesn't need to
check the BF54xM variant everytime it wants to check the BF54x.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:45 -05:00
Mike Frysinger 2f5a086402 Blackfin: finish_atomic_sections: optimize the RTS step
No point in returning to userspace just to have it immediately perform the
RTS step.  We have to update the PC anyways, so do the RTS too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:42 -05:00
Sonic Zhang 0d5e35940b Blackfin: kgdb: punt dead code
None of these vars/funcs were being used.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:40 -05:00
Mike Frysinger e34132f40b Blackfin: reject NULL callback in set_dma_callback()
It makes no sense to call this function with a NULL callback.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:37 -05:00
Mike Frysinger 43acb9cdef Blackfin: punt dead/unused flash mem_init settings
I don't think these defines were ever used.  At any rate, we have common
bit defines for all parts as well as a Kconfig option to declare the EBIU
async timings, and no one has really complained about this so far.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:33 -05:00
Mike Frysinger 8c0b4351cc Blackfin: gptimers: use unsigned timer/group ids
Since we always use these ids as unsigned values, and we have some assert
code to make sure they don't exceed a limit, avoid signed issues.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:30 -05:00
Robin Getz dbc5e6989e Blackfin: don't walk VMAs when oopsing
If we're double faulting, then we have to assume the VMAs are not safe as
broken pointers here will prevent full trace output for the double fault.
Shouldn't be a big problem though as rarely is a double fault caused by
code in userspace.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:28 -05:00
Mike Frysinger e92d32fcb9 Blackfin: force BFD target when linking modules
This allows us to use any Blackfin toolchain to create kernel modules
(such as the FDPIC bfin-linux-uclibc toolchain).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:25 -05:00
Mike Frysinger ee3773367b Blackfin: comment the FDPIC PTRACE defines
This matches similar documentation for the FRV FDPIC code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:23 -05:00
Philippe Gerum 2c29661e0b Blackfin/ipipe: update version stamp
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Li Yi <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:21 -05:00
Philippe Gerum 4815b883ed Blackfin/ipipe: introduce support for CONFIG_MPU
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Li Yi <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:18 -05:00
Philippe Gerum 7d4a005c43 Blackfin/ipipe: fix forward ref to barrier()
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Li Yi <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:15 -05:00
Philippe Gerum d2685fb7b4 Blackfin/ipipe: prepare status bitops for SMP support
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Li Yi <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:12 -05:00
Valentin Yakovenkov ab843c7940 Blackfin: add support for the Acvilon BF561 board
Signed-off-by: Valentin Yakovenkov <yakovenkov@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:10 -05:00
Mike Frysinger b2e8dbd204 Blackfin: add an uncompressed vmImage target
This is useful for quick tests where networks are faster than compression,
and/or the compression code is broken.

Reported-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:08 -05:00
Mike Frysinger 13a1320cf5 Blackfin: don't give CPU its own line in traps output
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:05 -05:00
Robin Getz 7a1a8cc190 Blackfin: announce current cpu rev when booting
User reports rarely include full information, so include this important
tidbit up front.  It's also good to know at a glance in general.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:15:01 -05:00
Mike Frysinger 00d2460454 Blackfin: unify DMA masks
Every Blackfin variant has the same DMA bit masks, so avoid duplicating
them over and over in each mach header.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:59 -05:00
Michael Hennerich c6feb76828 Blackfin: fix typo in isp1760 platform name
The driver changed from "isp1760-hcd" to "isp1760", so update resources
to match.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:55 -05:00
Mike Frysinger a8e8e49168 Blackfin: unify duplicated power masks
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:53 -05:00
Mike Frysinger 761ec44add Blackfin: pull in asm/dpmc.h for power defines
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:50 -05:00
Mike Frysinger 2abdf79115 Blackfin: H8606/ip0x: drop redundant SPI ctl_reg settings
No need to set MSTR in .ctl_reg as the Blackfin SPI bus driver does this
already for all parts.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:49 -05:00
Mike Frysinger cfed440997 Blackfin: BF54x: punt useless "masks" for count/address MMRs
There's no point in having mask defines when the entire MMR value is a
count or address.  i.e. applying a mask of -1 is pointless.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:45 -05:00
Mike Frysinger e153a97c21 Blackfin: punt unused MXVR masks
There are no MXVR device drivers, and if someday there is, we can put
these in a dedicated header rather than polluting the global namespace.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:43 -05:00
Mike Frysinger cd32cc7362 Blackfin: punt OTP MMRs
People should not be accessing OTP MMRs directly.  They should instead go
through the Blackfin ROM helper functions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:40 -05:00
Mike Frysinger b1fa2e8f62 Blackfin: BF51x: dump non-existent SPI/NFC MMRs
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:39 -05:00
Mike Frysinger 341a1fc0d1 Blackfin: scrub unused watchdog mmr masks
The watchdog code doesn't need these, and the other parts had these
punted, so keep the global namespace clean.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:36 -05:00
Mike Frysinger 1915b6c0ae Blackfin: scrub unused RTC masks
The RTC driver code doesn't need these, and the other parts had these
punted, so keep the global namespace clean.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:33 -05:00
Mike Frysinger 60883e28b3 Blackfin: unify BF547/8/9 headers
No point in duplicating entire lists when we can simply tail into other
parts for most of the MMRs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:31 -05:00
Mike Frysinger 4ed250a563 Blackfin: fix some BF547 header copy & paste typos
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:28 -05:00
Mike Frysinger 5da8a3dc48 Blackfin: rename BF542 host dma defines
All the other BF54x parts had these defines renamed to avoid collision,
but it looks the BF542 was missed somehow.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:25 -05:00
Mike Frysinger 17a1b5e374 Blackfin: coreb: switched to unlocked_ioctl
We don't need the BKL and now people will stop looking at this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:21 -05:00
Mike Frysinger d2e015d65f Blackfin: convert DMA mutex to an atomic and drop redundant code
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-12-15 00:14:18 -05:00
Michael Hennerich adfc046740 Blackfin: update bfin_rotary defines
The driver was moved during the merge process, so update the defines to
match the new location.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:16 -05:00
Mike Frysinger bbc51e97d3 Blackfin: push down asm/ includes and out of bfin-global.h
Avoid including unnecessary headers all the time as well as circular
includes with core requirements.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:14 -05:00
Mike Frysinger 872d024b40 Blackfin: pull in firmware Kconfig
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:12 -05:00
Mike Frysinger b6357116c4 Blackfin: BF51x/BF52x: fill out bfin_clear_PPI_STATUS()
All the arches define a helper macro to make things easy for driver code.

Reported-by: Frank Van Hooft <frank@frankvh.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:09 -05:00
Barry Song 6e3647554e Blackfin: bf537-stamp: need io.h for writeb() funcs
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:08 -05:00
Michael Hennerich 621dd24743 Blackfin: bf538: add support for extended GPIO banks
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>
2009-12-15 00:14:05 -05:00
Graf Yang 46fe23ac39 Blackfin: add C define of trace_buffer_init()
Have the C API trace funcs match the assembly API trace funcs.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:03 -05:00
Michael Hennerich d887a1ce28 Blackfin: cpufreq: use a constant latency
PLL_LOCKCNT applies only to the PLL programming sequence which does not
apply to core and system clock dividers.  Writes to PLL_DIV to change the
CSEL/SSEL dividers take effect immediately.

There is still overhead in software in writing the new dividers, so just
use a value of 50us as this should be good enough.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:14:00 -05:00
Mike Frysinger 21b03cfe4c Blackfin: clean up isp1362 board resources
Drop the CONFIG_USB_ISP1362_BFIN_GPIO_IRQ Kconfig as it never made it into
mainline and it was a bad interface into the board resources.  For boards
that actually used this, replace it with an actual IRQ define.  For boards
that didn't, simply drop the resources.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:13:58 -05:00
Mike Frysinger 5cd82a6d58 Blackfin: calculate on-chip lengths at link time rather than run time
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>
2009-12-15 00:13:55 -05:00
Bernd Schmidt 13048f8866 Blackfin: improve async bank access checking (for cross-banks & XIP)
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>
2009-12-15 00:13:52 -05:00
Michael Hennerich cb5ae60f7a Blackfin: convert DMA code to a proper bitmap
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>
2009-12-15 00:13:51 -05:00
Michael Hennerich ddcd7cb857 Blackfin: clean up bf537-lq035 board resources
Now that the driver has been updated, convert the board resources to the
new i2c framework for managing slaves.

For boards that don't actually hook up to this hardware, simply drop the
resources altogether.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:13:48 -05:00
Barry Song 89e84eeace Blackfin: add some bounds checking to peripheral_request
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>
2009-12-15 00:13:46 -05:00
Yi Li 298571249a Blackfin: use common code for cycle->nanosecond conversion
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>
2009-12-15 00:13:43 -05:00
Yi Li ceb33be95a Blackfin: unify sched_clock() handling between clock sources
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>
2009-12-15 00:13:41 -05:00
Yi Li f7036d649c Blackfin: fix gptimer0 clock source compile warning
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>
2009-12-15 00:13:38 -05:00
Mike Frysinger 3a022ba9ac Blackfin: update defconfigs
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Harald Krapfenbauer <Harald.Krapfenbauer@bluetechnix.at>
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:13:37 -05:00
Mike Frysinger ddf9ddacef Blackfin: convert to generic checksum code
The Blackfin port only implemented an optimized version of the
csum_tcpudp_nofold function, so convert everything else to the new
generic code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15 00:13:32 -05:00
Thomas Gleixner 239007b844 genirq: Convert irq_desc.lock to raw_spinlock
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
2009-12-14 23:55:33 +01:00
Thomas Gleixner e5931943d0 locking: Convert raw_rwlock functions to arch_rwlock
Name space cleanup for rwlock functions. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner fb3a6bbc91 locking: Convert raw_rwlock to arch_rwlock
Not strictly necessary for -rt as -rt does not have non sleeping
rwlocks, but it's odd to not have a consistent naming convention.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner 0199c4e68d locking: Convert __raw_spin* functions to arch_spin*
Name space cleanup. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner edc35bd72e locking: Rename __RAW_SPIN_LOCK_UNLOCKED to __ARCH_SPIN_LOCK_UNLOCKED
Further name space cleanup. No functional change

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner 445c89514b locking: Convert raw_spinlock to arch_spinlock
The raw_spin* namespace was taken by lockdep for the architecture
specific implementations. raw_spin_* would be the ideal name space for
the spinlocks which are not converted to sleeping locks in preempt-rt.

Linus suggested to convert the raw_ to arch_ locks and cleanup the
name space instead of using an artifical name like core_spin,
atomic_spin or whatever

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Sam Ravnborg 559df2e021 kbuild: move asm-offsets.h to include/generated
The simplest method was to add an extra asm-offsets.h
file in arch/$ARCH/include/asm that references the generated file.

We can now migrate the architectures one-by-one to reference
the generated file direct - and when done we can delete the
temporary arch/$ARCH/include/asm/asm-offsets.h file.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:14 +01:00
Linus Torvalds 3126c136bc Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (21 commits)
  ext3: PTR_ERR return of wrong pointer in setup_new_group_blocks()
  ext3: Fix data / filesystem corruption when write fails to copy data
  ext4: Support for 64-bit quota format
  ext3: Support for vfsv1 quota format
  quota: Implement quota format with 64-bit space and inode limits
  quota: Move definition of QFMT_OCFS2 to linux/quota.h
  ext2: fix comment in ext2_find_entry about return values
  ext3: Unify log messages in ext3
  ext2: clear uptodate flag on super block I/O error
  ext2: Unify log messages in ext2
  ext3: make "norecovery" an alias for "noload"
  ext3: Don't update the superblock in ext3_statfs()
  ext3: journal all modifications in ext3_xattr_set_handle
  ext2: Explicitly assign values to on-disk enum of filetypes
  quota: Fix WARN_ON in lookup_one_len
  const: struct quota_format_ops
  ubifs: remove manual O_SYNC handling
  afs: remove manual O_SYNC handling
  kill wait_on_page_writeback_range
  vfs: Implement proper O_SYNC semantics
  ...
2009-12-11 15:31:13 -08:00
Al Viro f8b7256096 Unify sys_mmap*
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>
2009-12-11 06:44:29 -05:00
Christoph Hellwig 6b2f3d1f76 vfs: Implement proper O_SYNC semantics
While Linux provided an O_SYNC flag basically since day 1, it took until
Linux 2.4.0-test12pre2 to actually get it implemented for filesystems,
since that day we had generic_osync_around with only minor changes and the
great "For now, when the user asks for O_SYNC, we'll actually give
O_DSYNC" comment.  This patch intends to actually give us real O_SYNC
semantics in addition to the O_DSYNC semantics.  After Jan's O_SYNC
patches which are required before this patch it's actually surprisingly
simple, we just need to figure out when to set the datasync flag to
vfs_fsync_range and when not.

This patch renames the existing O_SYNC flag to O_DSYNC while keeping it's
numerical value to keep binary compatibility, and adds a new real O_SYNC
flag.  To guarantee backwards compatiblity it is defined as expanding to
both the O_DSYNC and the new additional binary flag (__O_SYNC) to make
sure we are backwards-compatible when compiled against the new headers.

This also means that all places that don't care about the differences can
just check O_DSYNC and get the right behaviour for O_SYNC, too - only
places that actuall care need to check __O_SYNC in addition.  Drivers and
network filesystems have been updated in a fail safe way to always do the
full sync magic if O_DSYNC is set.  The few places setting O_SYNC for
lower layers are kept that way for now to stay failsafe.

We enforce that O_DSYNC is set when __O_SYNC is set early in the open path
to make sure we always get these sane options.

Note that parisc really screwed up their headers as they already define a
O_DSYNC that has always been a no-op.  We try to repair it by using it for
the new O_DSYNC and redefinining O_SYNC to send both the traditional
O_SYNC numerical value _and_ the O_DSYNC one.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger@sun.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
2009-12-10 15:02:50 +01:00
Linus Torvalds 4ef58d4e2a Merge branch 'for-linus' of 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
  ...
2009-12-09 19:43:33 -08:00
Linus Torvalds 2588465bad Merge branch 'bkl-arch-for-linus' of 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
2009-12-09 08:07:51 -08:00
Linus Torvalds 6035ccd8e9 Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block: (113 commits)
  cfq-iosched: Do not access cfqq after freeing it
  block: include linux/err.h to use ERR_PTR
  cfq-iosched: use call_rcu() instead of doing grace period stall on queue exit
  blkio: Allow CFQ group IO scheduling even when CFQ is a module
  blkio: Implement dynamic io controlling policy registration
  blkio: Export some symbols from blkio as its user CFQ can be a module
  block: Fix io_context leak after failure of clone with CLONE_IO
  block: Fix io_context leak after clone with CLONE_IO
  cfq-iosched: make nonrot check logic consistent
  io controller: quick fix for blk-cgroup and modular CFQ
  cfq-iosched: move IO controller declerations to a header file
  cfq-iosched: fix compile problem with !CONFIG_CGROUP
  blkio: Documentation
  blkio: Wait on sync-noidle queue even if rq_noidle = 1
  blkio: Implement group_isolation tunable
  blkio: Determine async workload length based on total number of queues
  blkio: Wait for cfq queue to get backlogged if group is empty
  blkio: Propagate cgroup weight updation to cfq groups
  blkio: Drop the reference to queue once the task changes cgroup
  blkio: Provide some isolation between groups
  ...
2009-12-08 08:19:16 -08:00
Jiri Kosina d014d04386 Merge branch 'for-next' into for-linus
Conflicts:

	kernel/irq/chip.c
2009-12-07 18:36:35 +01:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
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>
2009-12-04 15:39:55 +01:00
Jens Axboe 220d0b1dbf Merge branch 'master' into for-2.6.33 2009-12-03 13:49:39 +01:00
David S. Miller ff9c38bba3 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	net/mac80211/ht.c
2009-12-01 22:13:38 -08:00
Ilya Loginov 2d4dc890b5 block: add helpers to run flush_dcache_page() against a bio and a request's pages
Mtdblock driver doesn't call flush_dcache_page for pages in request.  So,
this causes problems on architectures where the icache doesn't fill from
the dcache or with dcache aliases.  The patch fixes this.

The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
pointless empty cache-thrashing loops on architectures for which
flush_dcache_page() is a no-op.  Every architecture was provided with this
flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
equal 1 or do nothing otherwise.

See "fix mtd_blkdevs problem with caches on some architectures" discussion
on LKML for more information.

Signed-off-by: Ilya Loginov <isloginov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Peter Horton <phorton@bitbox.co.uk>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-26 09:16:19 +01:00
Graf Yang aa23531ce5 Blackfin: fix SMP build error in start_thread()
Commit d5ce528c8e (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>
2009-11-25 02:38:01 -05:00
Roel Kluin 05bad36ce7 Blackfin: fix memset in smp_send_reschedule() and -stop()
To set zeroes the sizeof the struct should be used rather
than sizeof the pointer, kzalloc does that.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-25 02:35:45 -05:00
Jie Zhang 46b60faf8c Blackfin: fix typo in ptrace poking
Commit c014e15a2f (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>
2009-11-25 02:35:43 -05:00
Mike Frysinger a2ca78cee1 Blackfin: check for anomaly 05000475
Parts that have on-chip L2 SRAM cannot safely utilize writeback caching
mode, so reject any attempts to use it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-25 02:35:41 -05:00
Mike Frysinger f99e8c1d0f Blackfin: work around testset anomaly 05000477
Ironically, the atomic testset instruction cannot be interrupted else it
will produce incorrect results.  So disable interrupts to help it out.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-25 02:35:39 -05:00
Mike Frysinger af5d7fc7e4 Blackfin: update anomaly lists
Add some recently documented anomalies (473, 474, 475, 477).  Also stick
a "do not edit" notice in here so people know these are copies of some
master version.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-25 02:35:37 -05:00
André Goddard Rosa 7bae2c4898 Blackfin: fix cache Kconfig typo
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>
2009-11-25 02:35:35 -05:00
Michael Hennerich 865bddfbf7 Blackfin: fix suspend/resume failure with some on-chip ROMs
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-11-25 02:35:33 -05:00
David S. Miller 3505d1a9fd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/sfc/sfe4001.c
	drivers/net/wireless/libertas/cmd.c
	drivers/staging/Kconfig
	drivers/staging/Makefile
	drivers/staging/rtl8187se/Kconfig
	drivers/staging/rtl8192e/Kconfig
2009-11-18 22:19:03 -08:00
Rusty Russell dd17c8f729 percpu: remove per_cpu__ prefix.
Now that the return from alloc_percpu is compatible with the address
of per-cpu vars, it makes sense to hand around the address of per-cpu
variables.  To make this sane, we remove the per_cpu__ prefix we used
created to stop people accidentally using these vars directly.

Now we have sparse, we can use that (next patch).

tj: * Updated to convert stuff which were missed by or added after the
      original patch.

    * Kill per_cpu_var() macro.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
2009-10-29 22:34:15 +09:00
John Kacur 25708a5fe7 blackfin: Remove the BKL from sys_execve
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>
2009-10-14 17:18:14 +02:00
Arnaldo Carvalho de Melo a2e2725541 net: Introduce recvmmsg socket syscall
Meaning receive multiple messages, reducing the number of syscalls and
net stack entry/exit operations.

Next patches will introduce mechanisms where protocols that want to
optimize this operation will provide an unlocked_recvmsg operation.

This takes into account comments made by:

. Paul Moore: sock_recvmsg is called only for the first datagram,
  sock_recvmsg_nosec is used for the rest.

. Caitlin Bestler: recvmmsg now has a struct timespec timeout, that
  works in the same fashion as the ppoll one.

  If the underlying protocol returns a datagram with MSG_OOB set, this
  will make recvmmsg return right away with as many datagrams (+ the OOB
  one) it has received so far.

. Rémi Denis-Courmont & Steven Whitehouse: If we receive N < vlen
  datagrams and then recvmsg returns an error, recvmmsg will return
  the successfully received datagrams, store the error and return it
  in the next call.

This paves the way for a subsequent optimization, sk_prot->unlocked_recvmsg,
where we will be able to acquire the lock only at batch start and end, not at
every underlying recvmsg call.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-12 23:40:10 -07:00
Alexey Dobriyan d43c36dc6b headers: remove sched.h from interrupt.h
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>
2009-10-11 11:20:58 -07:00
Michael Hennerich 796dada9f5 Blackfin: convert to GENERIC_HARDIRQS_NO__DO_IRQ
Blackfin already sets proper flow handlers on all IRQs, and we don't rely
on __do_IRQ, therefore we can simply select GENERIC_HARDIRQS_NO__DO_IRQ.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:58:20 -04:00
Mike Frysinger 282246dae8 Blackfin: drop all simple-gpio board resources
The simple-gpio has been replaced by the gpio sysfs interface, so drop the
unused simple-gpio resources from all Blackfin boards.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:58:18 -04:00
Thomas Chou 59bd00c850 Blackfin: fix framebuffer mmap bug for nommu
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>
2009-10-08 00:58:15 -04:00
Jaswinder Singh Rajput 4a7bcb4fe9 Blackfin: includecheck fix: mach-bf548, ezkit.c
Fix the following 'make includecheck' warning:

  arch/blackfin/mach-bf548/boards/ezkit.c: linux/input.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:58:13 -04:00
Mike Frysinger 5a2b0d7315 Blackfin: drop cs_change_per_word setting
Structs get initialized to 0 already, and we want to punt this field, so
scrub it from all of our boards.

Reported-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:58:11 -04:00
Mike Frysinger 7036c61fe0 Blackfin: bf533-ezkit: convert to physmap/jedec_probe
Now that the common jedec_probe supports the ST PSD4256G6V, no need to
use the custom stm_flash driver.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:58:07 -04:00
Michael Hennerich 50c4c0861a Blackfin: convert adv7393 resources to new i2c framework
Now that the driver has been updated, convert the board resources to the
new i2c framework for managing slaves.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 00:57:54 -04:00
Graf Yang 19a3b6034a Blackfin: fix missed cache config renames
Looks like the big Kconfig cache split/rename missed one spot in the SMP
cache lock headers.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-07 04:48:08 -04:00
Mike Frysinger 48dee09325 Blackfin: cplbinfo: drop d_path() hacks
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>
2009-10-07 04:48:04 -04:00
Mike Frysinger d586e833f9 Blackfin: asm/irq.h: pull in mach/anomaly.h for anomaly defines
The asm/irq.h header uses anomaly defines, but doesn't make sure to
explicitly include the anomaly header for them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-07 04:48:01 -04:00
Barry Song 6206f709d9 Blackfin: BF51x: add PTP MMR defines 2009-10-07 04:47:57 -04:00
Robin Getz 96f1050d3d Blackfin: mass clean up of copyright/licensing info
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-10-07 04:36:26 -04:00
john stultz 10f03f1a24 Blackfin: convert to use arch_gettimeoffset()
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>
2009-10-07 04:36:20 -04:00
Alexey Dobriyan 828c09509b const: constify remaining file_operations
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01 16:11:11 -07:00
Tim Abbott 4a5e35135d blackfin: Cleanup linker script using new linker script macros.
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>
2009-09-24 17:16:22 -07:00
Linus Torvalds c37efa9325 Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (30 commits)
  Use macros for .data.page_aligned section.
  Use macros for .bss.page_aligned section.
  Use new __init_task_data macro in arch init_task.c files.
  kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts.
  arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0
  kbuild: add static to prototypes
  kbuild: fail build if recordmcount.pl fails
  kbuild: set -fconserve-stack option for gcc 4.5
  kbuild: echo the record_mcount command
  gconfig: disable "typeahead find" search in treeviews
  kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling
  checkincludes.pl: add option to remove duplicates in place
  markup_oops: use modinfo to avoid confusion with underscored module names
  checkincludes.pl: provide usage helper
  checkincludes.pl: close file as soon as we're done with it
  ctags: usability fix
  kernel hacking: move STRIP_ASM_SYMS from General
  gitignore usr/initramfs_data.cpio.bz2 and usr/initramfs_data.cpio.lzma
  kbuild: Check if linker supports the -X option
  kbuild: introduce ld-option
  ...

Fix trivial conflict in scripts/basic/fixdep.c
2009-09-23 15:37:02 -07:00
Mike Frysinger e56770fbc4 Blackfin: override text/data checking functions
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Robin Getz <rgetz@blackfin.uclinux.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23 07:39:32 -07:00
Linus Torvalds 342ff1a1b5 Merge branch 'for-linus' of 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: (34 commits)
  trivial: fix typo in aic7xxx comment
  trivial: fix comment typo in drivers/ata/pata_hpt37x.c
  trivial: typo in kernel-parameters.txt
  trivial: fix typo in tracing documentation
  trivial: add __init/__exit macros in drivers/gpio/bt8xxgpio.c
  trivial: add __init macro/ fix of __exit macro location in ipmi_poweroff.c
  trivial: remove unnecessary semicolons
  trivial: Fix duplicated word "options" in comment
  trivial: kbuild: remove extraneous blank line after declaration of usage()
  trivial: improve help text for mm debug config options
  trivial: doc: hpfall: accept disk device to unload as argument
  trivial: doc: hpfall: reduce risk that hpfall can do harm
  trivial: SubmittingPatches: Fix reference to renumbered step
  trivial: fix typos "man[ae]g?ment" -> "management"
  trivial: media/video/cx88: add __init/__exit macros to cx88 drivers
  trivial: fix typo in CONFIG_DEBUG_FS in gcov doc
  trivial: fix missing printk space in amd_k7_smp_check
  trivial: fix typo s/ketymap/keymap/ in comment
  trivial: fix typo "to to" in multiple files
  trivial: fix typos in comments s/DGBU/DBGU/
  ...
2009-09-22 07:51:45 -07:00
Anand Gadiyar 411c940385 trivial: fix typo "for for" in multiple files
trivial: fix typo "for for" in multiple files

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-21 15:14:54 +02:00
Ingo Molnar cdd6c482c9 perf: Do the big rename: Performance Counters -> Performance Events
Bye-bye Performance Counters, welcome Performance Events!

In the past few months the perfcounters subsystem has grown out its
initial role of counting hardware events, and has become (and is
becoming) a much broader generic event enumeration, reporting, logging,
monitoring, analysis facility.

Naming its core object 'perf_counter' and naming the subsystem
'perfcounters' has become more and more of a misnomer. With pending
code like hw-breakpoints support the 'counter' name is less and
less appropriate.

All in one, we've decided to rename the subsystem to 'performance
events' and to propagate this rename through all fields, variables
and API names. (in an ABI compatible fashion)

The word 'event' is also a bit shorter than 'counter' - which makes
it slightly more convenient to write/handle as well.

Thanks goes to Stephane Eranian who first observed this misnomer and
suggested a rename.

User-space tooling and ABI compatibility is not affected - this patch
should be function-invariant. (Also, defconfigs were not touched to
keep the size down.)

This patch has been generated via the following script:

  FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')

  sed -i \
    -e 's/PERF_EVENT_/PERF_RECORD_/g' \
    -e 's/PERF_COUNTER/PERF_EVENT/g' \
    -e 's/perf_counter/perf_event/g' \
    -e 's/nb_counters/nb_events/g' \
    -e 's/swcounter/swevent/g' \
    -e 's/tpcounter_event/tp_event/g' \
    $FILES

  for N in $(find . -name perf_counter.[ch]); do
    M=$(echo $N | sed 's/perf_counter/perf_event/g')
    mv $N $M
  done

  FILES=$(find . -name perf_event.*)

  sed -i \
    -e 's/COUNTER_MASK/REG_MASK/g' \
    -e 's/COUNTER/EVENT/g' \
    -e 's/\<event\>/event_id/g' \
    -e 's/counter/event/g' \
    -e 's/Counter/Event/g' \
    $FILES

... to keep it as correct as possible. This script can also be
used by anyone who has pending perfcounters patches - it converts
a Linux kernel tree over to the new naming. We tried to time this
change to the point in time where the amount of pending patches
is the smallest: the end of the merge window.

Namespace clashes were fixed up in a preparatory patch - and some
stylistic fallout will be fixed up in a subsequent patch.

( NOTE: 'counters' are still the proper terminology when we deal
  with hardware registers - and these sed scripts are a bit
  over-eager in renaming them. I've undone some of that, but
  in case there's something left where 'counter' would be
  better than 'event' we can undo that on an individual basis
  instead of touching an otherwise nicely automated patch. )

Suggested-by: Stephane Eranian <eranian@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <linux-arch@vger.kernel.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-21 14:28:04 +02:00
Sam Ravnborg caa27b66bd kbuild: use INSTALLKERNEL to select customized installkernel script
Replace the use of CROSS_COMPILE to select a customized
installkernel script with the possibility to set INSTALLKERNEL
to select a custom installkernel script when running make:

    make INSTALLKERNEL=arm-installkernel install

With this patch we are now more consistent across
different architectures - they did not all support use
of CROSS_COMPILE.

The use of CROSS_COMPILE was a hack as this really belongs
to gcc/binutils and the installkernel script does not change
just because we change toolchain.

The use of CROSS_COMPILE caused troubles with an upcoming patch
that saves CROSS_COMPILE when a kernel is built - it would no
longer be installable.
[Thanks to Peter Z. for this hint]

This patch undos what Ian did in commit:

  0f8e2d62fa
  ("use ${CROSS_COMPILE}installkernel in arch/*/boot/install.sh")

The patch has been lightly tested on x86 only - but all changes
looks obvious.

Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
Acked-by: Russell King <linux@arm.linux.org.uk> [arm]
Acked-by: Paul Mundt <lethal@linux-sh.org> [sh]
Acked-by: "H. Peter Anvin" <hpa@zytor.com> [x86]
Cc: Ian Campbell <icampbell@arcom.com>
Cc: Tony Luck <tony.luck@intel.com> [ia64]
Cc: Fenghua Yu <fenghua.yu@intel.com> [ia64]
Cc: Hirokazu Takata <takata@linux-m32r.org> [m32r]
Cc: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
Cc: Kyle McMartin <kyle@mcmartin.ca> [parisc]
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> [powerpc]
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
Cc: Thomas Gleixner <tglx@linutronix.de> [x86]
Cc: Ingo Molnar <mingo@redhat.com> [x86]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-09-20 12:18:14 +02:00
Yi Li 5bf9cbef99 Blackfin: update ftrace for latest toolchain
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>
2009-09-16 22:10:52 -04:00
Mike Frysinger 3b67d91b3e Blackfin: fix elf_fpregset_t definition
The elf_fpregset_t type relied on an empty struct in the asm/user.h, but
the transition to asm-generic/user.h dropped that empty struct.  Rather
than restore this useless struct, define the only user (elf_fpregset_t)
as an empty struct itself.  This fixes building when ELF dump support is
enabled.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:51 -04:00
Mike Frysinger ea426e6c62 Blackfin: unify cache init functions
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>
2009-09-16 22:10:49 -04:00
Graf Yang e78feaaeeb Blackfin: swap clocksource ratings for gptimer/cycles
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>
2009-09-16 22:10:48 -04:00
Mike Frysinger 3289651a97 Blackfin: update ftrace_push_return_trace() breakage
Commit 71e308a239 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>
2009-09-16 22:10:47 -04:00
Harald Krapfenbauer 9c21453e37 Blackfin: update cm board resources
Signed-off-by: Harald Krapfenbauer <Harald.Krapfenbauer@bluetechnix.at>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:46 -04:00
Harald Krapfenbauer 6058434468 Blackfin: cm-bf537u: split board from cm-bf537e
The cm-bf537u module, while similar to the cm-bf537e, is different enough
to warrant its own resources.  It has a USB controller but no PHY.

Signed-off-by: Harald Krapfenbauer <Harald.Krapfenbauer@bluetechnix.at>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:45 -04:00
Barry Song 769cfc0d08 Blackfin: bf538-ezkit: add SPI IRQ resources
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:43 -04:00
Sonic Zhang 88c28b2df9 Blackfin: increase default async timings for parallel flashes
The default async timings are a little too fast for the parallel flash
that is attached by default to the async banks.  So slow things down a bit
so accessing the hardware is stable.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:42 -04:00
Bernd Schmidt 4663f6ef25 Blackfin: add ICPLB coverage for async banks
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>
2009-09-16 22:10:42 -04:00
Mingquan Pan 4a3e53c1c4 Blackfin: use KERN_ALERT in all kgdb_test output
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>
2009-09-16 22:10:40 -04:00
Yi Li 4e4d496ee3 Blackfin: fix BF54x SPI CS resources
The BF54x has three slave select signals for SPI0/SPI1, not eight.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:39 -04:00
Robin Getz 774b80229f Blackfin: fix typo in isram_write()
The DTEST write bit is 2, not 1.  Improve comments in the related macro
while we're here.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:38 -04:00
Michael Hennerich ba877d4491 Blackfin: bf537-stamp: add adp5588 gpio resources
For the adp5588 GPIO daughter card.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:37 -04:00
Mike Frysinger c40cdb2cbd Blackfin: add some isram-driver self tests
Make it easy to figure out if code changes here are correct.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:36 -04:00
Robin Getz dedfd5d7f2 Blackfin: workaround anomaly 05000283
Make sure our interrupt entry code with exact hardware errors handles
anomaly 05000283 (infinite stall in system MMR kill) so we don't stall
while under load.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:34 -04:00
Michael Hennerich 05d17dfaab Blackfin: fix spelling in a few comments
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:33 -04:00
Yi Li b6dbde27dd Blackfin: use raw_smp_processor_id() in exception code
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>
2009-09-16 22:10:32 -04:00
Michael Hennerich 00dd66d012 Blackfin: remove useless duplicated assignment in gpio code
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:31 -04:00
Ingo Molnar 8d7ac69ffa Blackfin: Fix link errors with binutils 2.19 and GCC 4.3
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>
2009-09-16 22:10:30 -04:00
Graf Yang 1794131471 Blackfin: handle the core timer interrupt with handle_percpu_irq on SMP
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:29 -04:00
Mike Frysinger 926494943b Blackfin: optimize fixed code handling for the most common case
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>
2009-09-16 22:10:28 -04:00
Barry Song dac981740f Blackfin: delete '-spi' suffix in ad1836/ad1938 driver name
The ASoC drivers have dropped the redundant "-spi" suffix in the driver
name, so update the board resources accordingly.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:27 -04:00
Mike Frysinger 3aa670419a Blackfin: punt dead cache locking code
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>
2009-09-16 22:10:25 -04:00
Mike Frysinger 0198b3bcae Blackfin: drop board resources for dead devices (pbx/ad9960)
These hardware devices are dead and the drivers never cleaned up/merged,
so punt the useless board resource info.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:24 -04:00
Yi Li c4baebf268 Blackfin: do not trace the exception handler
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>
2009-09-16 22:10:23 -04:00
Mike Frysinger 7b06263bd7 Blackfin: fix BF522/BF523 max VCO mixup
The BF522 and BF523 had their real max VCO values swapped.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:22 -04:00
Graf Yang ad46163ac2 Blackfin: SMP port does not yet support cpu frequency scaling
We have an item to get this fixed, but in the mean time, disable selection
via Kconfig dependencies.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:21 -04:00
Yi Li eb7bd9c461 Blackfin: cleanup sync handling when enabling/disabling cplbs
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>
2009-09-16 22:10:19 -04:00
Barry Song 8312440e05 Blackfin: bf537-stamp: update ad1836 resources
Update the ad1836 resources for the new ASoC driver.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:18 -04:00
Yi Li bd411b15cc Blackfin: update anomaly lists
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:16 -04:00
Barry Song f1cb64625c Blackfin: bf538-ezkit: add resources for parallel flash
The board has some parallel flash hooked up to the async banks, so add
appropriate physmap resources for it.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:15 -04:00
Roel Kluin ac860751eb Blackfin: fix read buffer overflow
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-16 22:10:13 -04:00
Stefan Pledl 0e101ec12e Blackfin: bf548-ezkit: fix incorrect LCD size parameters
I think we have to use the physical dimensions [mm] of the display for
.width and .heigth in struct bfin_bf54xfb_mach_info bf54x_lq043_data which
are copied to fbinfo->var.height/.width in bf54x-lq043fb.c.

linux/fb.h describes this values as 'height/weight of picture in mm'

Otherwise QT calcs the wrong dpi value and the displayed fonts are very
small.

Signed-off-by: Stefan Pledl <stefan.pledl@mesutronic.de>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:12 -04:00
Barry Song b3dec4a4ff Blackfin: cm-bf527/bf537-stamp: fix dm9000 resources
The dm9000 driver expects two IORESOURCE_MEM to get at the device, so make
sure we declare things properly.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:10:10 -04:00
Mike Frysinger 8d71e07596 Blackfin: drop unused MMR defines that only cause bad code to be written
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 22:09:55 -04:00
Michael Hennerich 61f09b5a09 Blackfin: convert boards to use platform data with smc91x
Latest smc91x driver allows you to specify settings in board resources
rather than needing CONFIG_BLACKFIN in the drivers/net/smc91x.h header.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:32:00 -04:00
Barry Song 2fff7f8800 Blackfin: bf537-stamp: drop ATA interrupt probe workaround
The interrupt probe workaround doesn't work without hacks to common code,
and the add-on card only needs a simple resistor to fix the problem, so
drop the board-specific hack.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:58 -04:00
Graf Yang 01b9f4b0ed Blackfin: improve double fault debug handling
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>
2009-09-16 21:31:57 -04:00
Cliff Cai 858c5e9abc Blackfin: bf533-stamp: fix typo in SPI frequency for ad1836 codec
One too many zeros means we run way faster than the codec can handle.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:56 -04:00
Graf Yang 36b8412886 Blackfin: fix MPU handling of invalid memory accesses
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>
2009-09-16 21:31:55 -04:00
Jean Delvare 8fc4dd9e87 Blackfin: clean up duplicate I2C device type definitions
I2C_BOARD_INFO() already sets .type, no need to set it again.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:53 -04:00
Barry Song 427f277e5f Blackfin: bf537-stamp: update AD714x resources
Push the device table to the board resources as data interpretation can be
changed on a per-board basis.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:51 -04:00
Sonic Zhang 407505dc01 Blackfin: do not try displaying the end of the stack
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>
2009-09-16 21:31:50 -04:00
Yi Li 2120b68f31 Blackfin: bf533-stamp: add resources for mmc_spi card
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:49 -04:00
Barry Song f41e2fded0 Blackfin: bf538: add bfin_clear_PPI_STATUS() helper
Add the bf538 version of bfin_clear_PPI_STATUS() to match all other ports.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:47 -04:00
Stefan Pledl a2f78cfc65 Blackfin: fix BF548 UART0 DMA IRQ translation
The initial BF54x port included some defines to keep code simple across
different processors, but it just ended up causing the UART0 DMA IRQs to
be set to the UART1 channels.

Signed-off-by: Stefan Pledl <stefan.pledl@mesutronic.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:46 -04:00
Robin Getz 837ec2d56c Blackfin: catch hardware errors earlier during booting
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-09-16 21:31:44 -04:00
Robin Getz 3f871feaf3 Blackfin: add an early shadow console
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>
2009-09-16 21:31:43 -04:00
Mike Frysinger 53e18df745 Blackfin: add support for common FDPIC ptrace requests
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>
2009-09-16 21:31:42 -04:00
Mike Frysinger 81c969a8bc Blackfin: push SRAM locks down into related ifdefs
Rather than defining the locks and initializing them all the time, only do
so when we actually need them (i.e. the SRAM regions exist).  This avoids
dead data and code bloat during runtime.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:31:41 -04:00
Sonic Zhang 9c954f8941 Blackfin: unify duplicated SMP checks in L2 cache kconfig
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:59 -04:00
Michael Hennerich 204844ebd0 Blackfin: rename PCF8574 driver config
The "TWI_KEYPAD" driver was renamed to "INPUT_PCF8574", so update the
defines in the board resources accordingly.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:57 -04:00
Robin Getz 2f812c0bd5 Blackfin: clean up early memory setup code
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>
2009-09-16 21:28:54 -04:00
Mike Frysinger a769094061 Blackfin: fix module reloc handling for all memory regions
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>
2009-09-16 21:28:52 -04:00
Mike Frysinger 459fec9073 Blackfin: cleanup module section checking
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>
2009-09-16 21:28:51 -04:00
Mike Frysinger 70deca9f9c Blackfin: convert malloc()/memset() to zalloc() in module code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:49 -04:00
Mike Frysinger dc6b1ac984 Blackfin: cleanup printk() usage in module code
Convert all printk() statements to use the common pr_xxx() funcs and use
the new pr_fmt() function to standardize all of the output.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:48 -04:00
Robin Getz 22532578ee Blackfin: reject outdated/unused/wrong relocation types
All kernel modules are required to be built with -mlong-calls and thus
should not generate any of these relocations.  If they do, it means the
module has not been compiled properly, so rather than trying to handle
them (and running into random run time errors) just error out on module
load to force the module to be compiled correctly.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:46 -04:00
Mike Frysinger c014e15a2f Blackfin: convert ptrace to new memory functions
Now that we have a Blackfin memory function to figure out how to properly
access the different regions, drop the custom memory range checks in our
ptrace code and use that.  It makes the code nicer and fixes bugs where
the ptrace logic wasn't handling all the different regions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:45 -04:00
Mike Frysinger 18070dd669 Blackfin: cleanup traps decode_address() a bit
Unify the address display to shrink the code, and add missing decoding of
a few special Blackfin-specific regions (L1 ROM and MMRs).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:43 -04:00
Philippe Gerum f4e129399c Blackfin: inline I-pipe bypass code in ret_from_exception
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:42 -04:00
Philippe Gerum 9ea7770fdb Blackfin: sanitize manual control of IPEND[4]
Cleanup is performed in two ways:

- remove extraneous updates of IPEND[4] w/ CONFIG_IPIPE,
  and document remaining use.

- substitute pop-reg-from-stack instructions with plain SP fixups in
  all save-RETI-then-discard patterns.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:40 -04:00
Philippe Gerum 7a7967dc1b Blackfin: document __ipipe_call_irqtail
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:38 -04:00
Philippe Gerum 70f4720232 Blackfin: allow EVT5 to preempt irqtail prologue (CONFIG_DEBUG_HWERR)
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:37 -04:00
Philippe Gerum fc9afb997f Blackfin: reuse evt_evt14 handler to perform irqtail epilogue
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:36 -04:00
Philippe Gerum 9703a73c98 Blackfin: use generic name for EVT14 handler
The purpose of the EVT14 handler may depend on whether CONFIG_IPIPE is
enabled, albeit its implementation can be the same in both cases. When
the interrupt pipeline is enabled, EVT14 can be used to raise the core
priority level for the running code; when CONFIG_IPIPE is off, EVT14
can be used to lower this level before running softirq handlers.

Rename evt14_softirq to evt_evt14 to pick an identifier that fits
both, which allows to reuse the same vector setup code as well.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:34 -04:00
Philippe Gerum 6b8019c85e Blackfin: allow high priority domains to preempt schedule_tail()
ret_from_fork is always entered with hw interrupts off, which prevents
real-time domains to preempt the Linux kernel during part of the
initial context switch to the new task, which could in turn raise the
worst-case latency figures.

To avoid this, stall the root domain stage in the interrupt pipeline
to keep the scheduling tail code free from Linux-handled IRQs, then
enable hardware interrupts again.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:33 -04:00
Philippe Gerum bc569f1a77 Blackfin: export show_stack() to modules
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:32 -04:00
Philippe Gerum b9c7eb498d Blackfin: fix misnomer of some I-pipe helpers
__ipipe_{stall, unstall}_root_raw() identifiers may leave the reader
under the impression that only the virtual state is affected by these
operations, which is wrong. Pick names following the convention used
throughout the interrupt pipeline code.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:30 -04:00
Philippe Gerum d8ca63955a Blackfin: checkpatch --file arch/blackfin/kernel/ipipe.c
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:29 -04:00
Robin Getz ae4f073c40 Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]
We handle many exceptions at EVT5 (hardware error level) so that we can
catch exceptions in our exception handling code.  Today - if the global
interrupt enable bit (IPEND[4]) is set (interrupts disabled) our trap
handling code goes into a infinite loop, since we need interrupts to be
on to defer things to EVT5.

Normal kernel code should not trigger this for any reason as IPEND[4] gets
cleared early (when doing an interrupt context save) and the kernel stack
there should be sane (or something much worse is happening in the system).
But there have been a few times where this has happened, so this change
makes sure we dump a proper crash message even when things have gone south.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:28 -04:00
Barry Song d4b834c139 Blackfin: bf537-stamp: add resources for AD1938 audio card
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:26 -04:00
Yi Li e68d1ebc30 Blackfin: bf537-stamp: declare SPI IRQ resources
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:24 -04:00
Michael Hennerich f39d56ec46 Blackfin: bf537-stamp: update ADP5588 header name
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16 21:28:23 -04:00
Linus Torvalds ada3fa1505 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits)
  powerpc64: convert to dynamic percpu allocator
  sparc64: use embedding percpu first chunk allocator
  percpu: kill lpage first chunk allocator
  x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA
  percpu: update embedding first chunk allocator to handle sparse units
  percpu: use group information to allocate vmap areas sparsely
  vmalloc: implement pcpu_get_vm_areas()
  vmalloc: separate out insert_vmalloc_vm()
  percpu: add chunk->base_addr
  percpu: add pcpu_unit_offsets[]
  percpu: introduce pcpu_alloc_info and pcpu_group_info
  percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward
  percpu: add @align to pcpu_fc_alloc_fn_t
  percpu: make @dyn_size mandatory for pcpu_setup_first_chunk()
  percpu: drop @static_size from first chunk allocators
  percpu: generalize first chunk allocator selection
  percpu: build first chunk allocators selectively
  percpu: rename 4k first chunk allocator to page
  percpu: improve boot messages
  percpu: fix pcpu_reclaim() locking
  ...

Fix trivial conflict as by Tejun Heo in kernel/sched.c
2009-09-15 09:39:44 -07:00
Tejun Heo 384be2b18a Merge branch 'percpu-for-linus' into percpu-for-next
Conflicts:
	arch/sparc/kernel/smp_64.c
	arch/x86/kernel/cpu/perf_counter.c
	arch/x86/kernel/setup_percpu.c
	drivers/cpufreq/cpufreq_ondemand.c
	mm/percpu.c

Conflicts in core and arch percpu codes are mostly from commit
ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
num_possible_cpus() with nr_cpu_ids.  As for-next branch has moved all
the first chunk allocators into mm/percpu.c, the changes are moved
from arch code to mm/percpu.c.

Signed-off-by: Tejun Heo <tj@kernel.org>
2009-08-14 14:45:31 +09:00
Michael Hennerich 4832958218 Input: add Blackfin rotary input driver
This driver handles the Blackfin on-chip rotary peripheral.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-23 01:15:09 -07:00
Mike Frysinger 6843f405da Blackfin: define HARDIRQ_BITS again for now
The default values of HARDIRQ_BITS and PREEMPT_BITS in common code leads to
build failure:

In file included from include/linux/interrupt.h:12,
                from include/linux/kernel_stat.h:8,
                from arch/blackfin/kernel/asm-offsets.c:32:
include/linux/hardirq.h:66:2: error: #error PREEMPT_ACTIVE is too low!

So until that gets resolved, just declare our own default value again.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 13:56:07 -04:00
Julia Lawall 994e9a2e01 arch/blackfin: Add kmalloc NULL tests
Check that the result of kmalloc is not NULL before passing it to other
functions.

In the first two cases, the new code returns -ENOMEM, which seems
compatible with what is done for similar functions for other architectures.

In the last two cases, the new code fails silently, ie just returns,
because the function has void return type.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:54 -04:00
Graf Yang 5bc6e3cfe6 Blackfin: add CPLB entries for Core B on-chip L1 SRAM regions
The Blackfin SMP port was missing CPLB entries for Core B on-chip L1 SRAM
regions.  Any code that attempted to use these would wrongly crash due to
a CPLB miss.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:51 -04:00
Robin Getz f574a76a3b Blackfin: work around anomaly 05000189
Similar to anomaly 05000281 but not as bad, we cannot return to the
instruction causing a fault otherwise we'll trigger a second false
exception.  The system can still recover, but it isn't correct.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:48 -04:00
Michael Hennerich c70c754ff9 Blackfin: drop per-cpu loops_per_jiffy tracking
On Blackfin SMP, a per-cpu loops_per_jiffy is pointless since both cores
always run at the same CCLK.  In addition, the current implementation has
flaws since the main consumer for loops_per_jiffy (asm/delay.h) uses the
global kernel loops_per_jiffy and not the per_cpu one.  So punt all of the
per-cpu handling and go back to the global shared one.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:44 -04:00
Michael Hennerich c03c2a8734 Blackfin: fix bugs in GPIO resume code
Change the bfin_gpio_pm_hibernate_restore() function to:
1) AND restored DATA with DIR (not OR) to get correct final state
2) Restore DATA before setting DIR to avoid glitches

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:42 -04:00
Barry Song 4c94c3e09a Blackfin: bf537-stamp: fix irq decl for AD7142
The AD7142 add-on card hooks the IRQ line up to PG5, not PF5.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:40 -04:00
Robin Getz ad863a9dc9 Blackfin: fix handling of IPEND in interrupt context save
The interrupt context save logic incorrectly stored the address of the
IPEND register rather than its value due to a missing dereference.  While
we're here, also enable this code for all kernel debugging scenarios and
not just when KGDB is enabled.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:38 -04:00
Robin Getz 3a920accbb Blackfin: drop duplicate runtime checking of anomaly 05000448
We already catch this anomaly at compile time, and the runtime version is
such that it ends up checking on all parts rather than just the ones that
might actually have it.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:34 -04:00
Michael Hennerich ebd5833327 Blackfin: fix incomplete renaming of the bfin-twi-lcd driver
The sed used to rename the bfin-twi-lcd only replaced the first instance
rather than all which led to the resources not being enabled when the
driver was built as a module.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:32 -04:00
Sonic Zhang f1c717fbf8 Blackfin: fix wrong CTS inversion
The Blackfin serial headers were inverting the CTS value leading to wrong
handling of the CTS line which broke CTS/RTS handling completely.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:30 -04:00
Graf Yang 10a5ecd03f Blackfin: update handling of anomaly 364 (wrong rev id in BF527-0.1)
This anomaly only applies to the BF527-0.1, not the BF526-0.1, and not any
other revision of the BF527.  So make sure we don't go returning 0xffff
for other cases.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16 01:52:28 -04:00
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
Tejun Heo 023bf6f1b8 linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences.  This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.

This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro.  As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.

ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.

defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390.  Michal Simek tested microblaze.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 11:27:40 +09: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
Tejun Heo c43768cbb7 Merge branch 'master' into for-next
Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
changes.  As alpha in percpu tree uses 'weak' attribute instead of
inline assembly, there's no need for __used attribute.

Conflicts:
	arch/alpha/include/asm/percpu.h
	arch/mn10300/kernel/vmlinux.lds.S
	include/linux/percpu-defs.h
2009-07-04 07:13:18 +09:00
Tejun Heo b9bf3121af percpu: use DEFINE_PER_CPU_SHARED_ALIGNED()
There are a few places where ___cacheline_aligned* is used with
DEFINE_PER_CPU().  Use DEFINE_PER_CPU_SHARED_ALIGNED() instead.

DEFINE_PER_CPU_SHARED_ALIGNED() applies alignment only on SMPs.  While
all other converted places used _in_smp variant or only get compiled
for SMP, net/rds used unconditional ____cacheline_aligned.  I don't
see any reason these data structures should be aligned on UP and thus
converted together.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Andy Grover <andy.grover@oracle.com>
2009-06-24 15:13:47 +09:00
Tejun Heo 405d967dc7 linker script: throw away .discard section
x86 throws away .discard section but no other archs do.  Also,
.discard is not thrown away while linking modules.  Make every arch
and module linking throw it away.  This will be used to define dummy
variables for percpu declarations and definitions.

This patch is based on Ivan Kokshaysky's alpha percpu patch.

[ Impact: always throw away everything in .discard ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
2009-06-24 15:13:38 +09: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
Mike Frysinger cf8d943260 Blackfin: only build irqpanic.c when needed
The irq_panic function is only used when CONFIG_DEBUG_ICACHE_CHECK is
enabled, so move the conditional build to the Makefile rather than
wrapping all of the contents of the file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:40:49 -04:00
Mike Frysinger abea0bc3d9 Blackfin: pull in asm/io.h in ksyms for prototypes
Make sure we pull in asm/io.h when exporting symbols for the I/O functions
so we don't end up with a build failure due to missing prototypes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:40:44 -04:00
Mike Frysinger c36953419b Blackfin: use common test_bit() rather than __test_bit()
Convert to test_bit() as that is what pretty much everyone uses and allows
us to migrate asm/bitops.h to the asm-generic version.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-18 21:40:40 -04:00
Linus Torvalds 517d08699b Merge branch 'akpm'
* akpm: (182 commits)
  fbdev: bf54x-lq043fb: use kzalloc over kmalloc/memset
  fbdev: *bfin*: fix __dev{init,exit} markings
  fbdev: *bfin*: drop unnecessary calls to memset
  fbdev: bfin-t350mcqb-fb: drop unused local variables
  fbdev: blackfin has __raw I/O accessors, so use them in fb.h
  fbdev: s1d13xxxfb: add accelerated bitblt functions
  tcx: use standard fields for framebuffer physical address and length
  fbdev: add support for handoff from firmware to hw framebuffers
  intelfb: fix a bug when changing video timing
  fbdev: use framebuffer_release() for freeing fb_info structures
  radeon: P2G2CLK_ALWAYS_ONb tested twice, should 2nd be P2G2CLK_DAC_ALWAYS_ONb?
  s3c-fb: CPUFREQ frequency scaling support
  s3c-fb: fix resource releasing on error during probing
  carminefb: fix possible access beyond end of carmine_modedb[]
  acornfb: remove fb_mmap function
  mb862xxfb: use CONFIG_OF instead of CONFIG_PPC_OF
  mb862xxfb: restrict compliation of platform driver to PPC
  Samsung SoC Framebuffer driver: add Alpha Channel support
  atmel-lcdc: fix pixclock upper bound detection
  offb: use framebuffer_alloc() to allocate fb_info struct
  ...

Manually fix up conflicts due to kmemcheck in mm/slab.c
2009-06-16 19:50:13 -07:00
Randy Dunlap e4c9dd0fba kmap_types: make most arches use generic header file
Convert most arches to use asm-generic/kmap_types.h.

Move the KM_FENCE_ macro additions into asm-generic/kmap_types.h,
controlled by __WITH_KM_FENCE from each arch's kmap_types.h file.

Would be nice to be able to add custom KM_types per arch, but I don't yet
see a nice, clean way to do that.

Built on x86_64, i386, mips, sparc, alpha(tonyb), powerpc(tonyb), and
68k(tonyb).

Note: avr32 should be able to remove KM_PTE2 (since it's not used) and
then just use the generic kmap_types.h file.  Get avr32 maintainer
approval.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "Luck Tony" <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16 19:47:51 -07:00
Alexey Dobriyan bb1f17b037 mm: consolidate init_mm definition
* create mm/init-mm.c, move init_mm there
* remove INIT_MM, initialize init_mm with C99 initializer
* unexport init_mm on all arches:

  init_mm is already unexported on x86.

  One strange place is some OMAP driver (drivers/video/omap/) which
  won't build modular, but it's already wants get_vm_area() export.
  Somebody should look there.

[akpm@linux-foundation.org: add missing #includes]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16 19:47:28 -07:00
Linus Torvalds 8d6cea5111 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (27 commits)
  Blackfin: hook up new rt_tgsigqueueinfo syscall
  Blackfin: improve CLKIN_HZ config default
  Blackfin: initial support for ftrace grapher
  Blackfin: initial support for ftrace
  Blackfin: enable support for LOCKDEP
  Blackfin: add preliminary support for STACKTRACE
  Blackfin: move custom sections into sections.h
  Blackfin: punt unused/wrong mutex-dec.h
  Blackfin: add support for irqflags
  Blackfin: add support for bzip2/lzma compressed kernel images
  Blackfin: convert Kconfig style to def_bool
  Blackfin: bf548-ezkit: update smsc911x resources
  Blackfin: update aedos-ipipe code to upstream 1.10-00
  Blackfin: bf537-stamp: update ADP5520 resources
  Blackfin: bf518f-ezbrd: fix SPI CS for SPI flash
  Blackfin: define SPI IRQ in board resources
  Blackfin: do not configure the UART early if on wrong processor
  Blackfin: fix deadlock in SMP IPI handler
  Blackfin: fix flag storage for irq funcs
  Blackfin: push down exception oops checking
  ...
2009-06-16 11:49:58 -07:00
Linus Torvalds 489f7ab6c1 Merge branch 'for-linus' of 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: (31 commits)
  trivial: remove the trivial patch monkey's name from SubmittingPatches
  trivial: Fix a typo in comment of addrconf_dad_start()
  trivial: usb: fix missing space typo in doc
  trivial: pci hotplug: adding __init/__exit macros to sgi_hotplug
  trivial: Remove the hyphen from git commands
  trivial: fix ETIMEOUT -> ETIMEDOUT typos
  trivial: Kconfig: .ko is normally not included in module names
  trivial: SubmittingPatches: fix typo
  trivial: Documentation/dell_rbu.txt: fix typos
  trivial: Fix Pavel's address in MAINTAINERS
  trivial: ftrace:fix description of trace directory
  trivial: unnecessary (void*) cast removal in sound/oss/msnd.c
  trivial: input/misc: Fix typo in Kconfig
  trivial: fix grammo in bus_for_each_dev() kerneldoc
  trivial: rbtree.txt: fix rb_entry() parameters in sample code
  trivial: spelling fix in ppc code comments
  trivial: fix typo in bio_alloc kernel doc
  trivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt
  trivial: Miscellaneous documentation typo fixes
  trivial: fix typo milisecond/millisecond for documentation and source comments.
  ...
2009-06-14 13:46:25 -07:00
Mike Frysinger 61cdd7a28f Blackfin: hook up new rt_tgsigqueueinfo syscall
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:23:18 -04:00
Mike Frysinger d0cb9b4ef6 Blackfin: improve CLKIN_HZ config default
Most boards use 25000000 as the default HZ, so rather than add a whole
bunch more boards, make it the default for everyone.  This also fixes
randconfig builds as there was no default before.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:16 -04:00
Mike Frysinger 1ee76d7e16 Blackfin: initial support for ftrace grapher
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:16 -04:00
Mike Frysinger 1c873be744 Blackfin: initial support for ftrace
Just the basic ftrace support here -- mcount and the ftrace stub.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:15 -04:00
Mike Frysinger 6fa68e7a7f Blackfin: enable support for LOCKDEP
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:15 -04:00
Mike Frysinger c7b412f41d Blackfin: add preliminary support for STACKTRACE
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:14 -04:00
Mike Frysinger 5203fa82f3 Blackfin: move custom sections into sections.h
The Blackfin arch has a bunch of custom section markings for its on-chip
regions, but they aren't declared in the right header.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:14 -04:00
Mike Frysinger e38eb89210 Blackfin: punt unused/wrong mutex-dec.h
Looks like the mutex-dec.h header file was incorrectly copied into the
Blackfin asm path.  Nothing uses it, so punt it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:14 -04:00
Mike Frysinger 8f86001f76 Blackfin: add support for irqflags
This converts the irq handling in the Blackfin arch from the old irq.h /
system.h method to the new irqflags.h.  A stepping stone on the way to
other tracing functionality.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:13 -04:00
Mike Frysinger 538067c822 Blackfin: add support for bzip2/lzma compressed kernel images
Since U-Boot can support these compression types, add appropriate targets
to the Blackfin boot files.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:13 -04:00
Mike Frysinger bac7d89ebe Blackfin: convert Kconfig style to def_bool
Makes the file easier to read when there isn't so much clutter.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:12 -04:00
Mike Frysinger 7a8b71db9d Blackfin: bf548-ezkit: update smsc911x resources
The older smsc911x driver made platform data optional, but the newer one
always requires it, so add proper settings to the BF548-EZKIT.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:12 -04:00
Yi Li 6640cfa82b Blackfin: update aedos-ipipe code to upstream 1.10-00
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:11 -04:00
Mike Frysinger 4f84b6e0bb Blackfin: bf537-stamp: update ADP5520 resources
The ADP5520 hooks up to PF7 rather than PG0.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:11 -04:00
Graf Yang a427293f84 Blackfin: bf518f-ezbrd: fix SPI CS for SPI flash
The SPI flash on the BF518F-EZBRD board is actually hooked up to CS2,
not CS1, so make sure the resources are correct.

URL: http://blackfin.uclinux.org/gf/tracker/5220
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:11 -04:00
Yi Li 53122693c3 Blackfin: define SPI IRQ in board resources
The Blackfin SPI driver can be driven by an IRQ now, so declare it in
the board resources.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:10 -04:00
Robin Getz 54ebae7166 Blackfin: do not configure the UART early if on wrong processor
Before we configure the early UART, check to make sure we are running on
the expected processor - otherwise, we cause problems by configuring pins
that don't exist (and causing an infinite loop of faults).

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:10 -04:00
Sonic Zhang 86f2008bf5 Blackfin: fix deadlock in SMP IPI handler
When a low priority interrupt (like ethernet) is triggered between 2 high
priority IPI messages, a deadlock in disable_irq() is hit by the second
IPI handler.  This is because the second IPI message is queued within the
first IPI handler, but the handler doesn't process all messages, and new
ones are inserted rather than appended.  So now we process all the pending
messages, and append new ones to the pending list.

URL: http://blackfin.uclinux.org/gf/tracker/5226
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:09 -04:00
Mike Frysinger f9ee3ab81c Blackfin: fix flag storage for irq funcs
The IRQ functions take an "unsigned long" flags variable, not any other
type, so fix the places where we use "int" or "long".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:09 -04:00
Mike Frysinger 82bd1d7d45 Blackfin: push down exception oops checking
Rather than maintain a duplicate list of valid exceptions we can take in
the kernel both in the first if() check and the switch() check, delay the
oops check to after the switch().  All valid exceptions will have returned
by this point leaving only the invalid ones.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:09 -04:00
Mike Frysinger 6510a20e1b Blackfin: fix trap_c() exit paths
The trap_c() code pushes the hardware trace status onto the stack, but
doesn't always restore it when returning from some trap code paths.  So
unify the exit code paths to all head to the end of the function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:09 -04:00
Sonic Zhang 47e9dedb72 Blackfin: add blackfin_invalidate_entire_icache for SMP systems
The KGDB code uses this when switching processors to make sure the icache
is in a valid state.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:07 -04:00
Robin Getz 2466ac6556 Blackfin: include the cpu compiled version in /proc/cpuinfo
Since the compiled-for cpu revision can be significant, include it in the
cpuinfo output along side the cpu revision we're currently running on.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:07 -04:00
Mike Frysinger 70f12567ac Blackfin: add support for GENERIC_BUG
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:07 -04:00
Jie Zhang 67834fa93d Blackfin: rename bfin_addr_dcachable to bfin_addr_dcacheable
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-13 07:20:06 -04:00
Mike Frysinger aa286ba3ae Blackfin: export ip_compute_csum/csum_partial_copy_from_user symbols
All other arches do this, and some places like the net/scsi code will fail
as modules without them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:06 -04:00
Robin Getz 16aadcb680 Blackfin: only handle CPLB protection violations when MPU is enabled
We don't need to handle CPLB protection violations unless we are running
with the MPU on.  Fix the entry code to call common trap_c, and remove the
code which is never run.  This allows the traps test suite to run on older
boards with the MPU disabled.

URL: http://blackfin.uclinux.org/gf/tracker/5129
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13 07:20:06 -04:00
Linus Torvalds cd166bd0dd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  add generic lib/checksum.c
  asm-generic: add a generic uaccess.h
  asm-generic: add generic NOMMU versions of some headers
  asm-generic: add generic atomic.h and io.h
  asm-generic: add legacy I/O header files
  asm-generic: add generic versions of common headers
  asm-generic: make bitops.h usable
  asm-generic: make pci.h usable directly
  asm-generic: make get_rtc_time overridable
  asm-generic: rename page.h and uaccess.h
  asm-generic: rename atomic.h to atomic-long.h
  asm-generic: add a generic unistd.h
  asm-generic: add generic ABI headers
  asm-generic: add generic sysv ipc headers
  asm-generic: introduce asm/bitsperlong.h
  asm-generic: rename termios.h, signal.h and mman.h
2009-06-12 18:15:51 -07:00
Pavel Machek 4737f0978d trivial: Kconfig: .ko is normally not included in module names
.ko is normally not included in Kconfig help, make it consistent.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 18:01:50 +02:00
Mike Frysinger bf664c0a3a Blackfin: fix sparseirq/kstat_irqs fallout
The sparseirq changes (d7e51e66) played poorly with the Blackfin irqchip
implementation as we're still using the old hardirq method.  Our bad irq
structure had a NULL kstat_irqs field so when all the common code tries
to increment this field, everything goes big bada boom.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:15:36 -04:00
Mike Frysinger ce0bf52dd3 Blackfin: fix unused warnings after nommu update
The massive nommu update (8feae131) left the local variable "vml" unused,
so punt it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:15:35 -04:00
Robin Getz 81f7f45606 Blackfin: export the last exception cause via debugfs
We have some test code that runs in userspace that exercises the exception
handling of the Blackfin pretty thoroughly.  Part of the validation process
is checking the exact exception triggered, so export the last one seen to
userspace via debugfs when debugging is enabled for the test code to check.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:15:28 -04:00
Roel Kluin 0a99061426 Blackfin: fix length checking in kgdb_ebin2mem
The kgdb_ebin2mem() was decrementing the count variable to do parsing, but
then later still tries to use it based on its original meaning.  So leave
it untouched and use a different variable to walk the memory.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:07 -04:00
Mike Frysinger 11aca0e735 Blackfin: kgdb: fix up error return values
The Blackfin kgdb code was all passing back positive errno values when it
really should have been using negative errno values.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:06 -04:00
Mike Frysinger a43b739f25 Blackfin: push access_ok() L1 attribute down
There is no need for the L1 attribute to be on the prototype of the
access_ok() function as all consumers of the function do not care where it
lives -- they'll always use pcrel calls to get to it.  This prevents
pointless recompiles of most of the system when this config option changes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:05 -04:00
Mike Frysinger 8d0d8f2a3a Blackfin: punt duplicated search_exception_table() prototype
The common code already has a prototype for this function and we don't use
it anywhere in the Blackfin code, so punt it from the Blackfin headers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:03 -04:00
Robin Getz a8372b5ca6 Blackfin: add missing access_ok() checks to user functions
The core string/clear user functions weren't checking the user pointers
which caused kernel crashes with some bad programs and tests (like LTP).

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:02 -04:00
Mike Frysinger 685a694f06 Blackfin: convert early_printk EVT init to a loop
The EVT registers are all contiguous in the memory map, so using a loop to
initialize them all rather than hardcoding the list results in much better
generated code (a hardware loop rather than a whole bunch of individual
loads).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:01 -04:00
Mike Frysinger f1db88d2a7 Blackfin: document the lsl variants of the L1 allocator
Make sure the meaning of "lsl" is covered somewhere and it is clear why we
somewhat duplicate the sram alloc/free functions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:12:00 -04:00
Mike Frysinger 595d681f2c Blackfin: rename Blackfin relocs according to the toolchain
The latest Blackfin toolchain has fixed its relocation scheme to match
other ports: always use R_BFIN_ prefix and capitalize everything.  This
brings the kernel in line with those fixes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:59 -04:00
Mike Frysinger 780172bf87 Blackfin: check SIC defines rather than variant names
Rather than having to maintain a hard coded list of Blackfin variants, use
the SIC defines themselves.  This fixes build problems on BF51x/BF538 under
some configurations as they were missing from one of the lists.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:58 -04:00
Sonic Zhang ea8538a039 Blackfin: add SSYNC to set_dma_sg() for descriptor fetching
Make sure the internal core buffers are flushed before telling the DMA
engine to fetch the descriptor structure so that it gets the right values.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:57 -04:00
Graf Yang 9b9bfded62 Blackfin: convert SMP to only use generic time framework
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:56 -04:00
Michael Hennerich ffc4d8bc44 Blackfin: bf548-ezkit/bf537-stamp: add resources for ADXL345/346
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:55 -04:00
Mike Frysinger 79df1b6947 Blackfin: override default uClinux MTD addr/size
Due to a processor anomaly (05000263 to be exact), most Blackfin parts
cannot keep the embedded filesystem image directly after the kernel in
RAM.  Instead, the filesystem needs to be relocated to the end of memory.
As such, we need to tweak the map addr/size during boot for Blackfin
systems.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:53 -04:00
Mike Frysinger 37082511f0 Blackfin: fix command line corruption with DEBUG_DOUBLEFAULT
Commit 6b3087c6 (which introduced Blackfin SMP) broke command line passing
when the DEBUG_DOUBLEFAULT config option was enabled.  Switch the code to
using a scratch register and not R7 which holds the command line.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:52 -04:00
Graf Yang 89ecd50691 Blackfin: fix handling of initial L1 reservation
This restores some L1 reservation logic that was lost during the Blackfin
SMP merge.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:51 -04:00
Graf Yang c72aa0794a Blackfin: merge sram init functions
Now that the sram_init() function exists only to call the bfin_sram_init()
after the punting of the reserve_pda() function, simply merge the two to
avoid pointless overhead.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:50 -04:00
Graf Yang d1800fe0e5 Blackfin: drop unused reserve_pda() function
The Per-processor Data Area isn't actually reserved by this function, and
all it ended up doing was issuing a printk(), so punt it.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:49 -04:00
Michael Hennerich c8d5ea8ccb Blackfin: update gptimers API
First we fix the prototypes for functions that return boolean values by
using "int" rather than "uint16_t".  Then we introduce a get_gptimer_run()
function for checking the current run status of a timer, and then we add a
disable_gptimers_sync() function which parallels disable_gptimers() with
corresponding normal "_sync" behavior.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:47 -04:00
Robin Getz 9ba3c24f10 Blackfin: include system/processor info in dump messages
People often copy & paste crash messages without surrounding context, so
include common useful information like system/processor stats in the crash
summary.  This should smooth over the report/test cycle a bit more.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:47 -04:00
Robin Getz 0acad8dfee Blackfin: add workaround for anomaly 05000461
Returning too fast with a bad RETI can trigger false errors.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:46 -04:00
Robin Getz a0cab65642 Blackfin: make sure stack is accessible before dumping it
When displaying a crash dump, make sure accessing the stack is safe so
we don't crash at the same time.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:45 -04:00
Robin Getz b9a3899d59 Blackfin: make deferred hardware errors more exact
Hardware errors on the Blackfin architecture are queued by nature of the
hardware design.  Things that could generate a hardware level queue up at
the system interface and might not process until much later, at which
point the system would send a notification back to the core.

As such, it is possible for user space code to do something that would
trigger a hardware error, but have it delay long enough for the process
context to switch.  So when the hardware error does signal, we mistakenly
evaluate it as a different process or as kernel context and panic (erp!).
This makes it pretty difficult to find the offending context.  But wait,
there is good news somewhere.

By forcing a SSYNC in the interrupt entry, we force all pending queues at
the system level to be processed and all hardware errors to be signaled.
Then we check the current interrupt state to see if the hardware error is
now signaled.  If so, we re-queue the current interrupt and return thus
allowing the higher priority hardware error interrupt to process properly.
Since we haven't done any other context processing yet, the right context
will be selected and killed.  There is still the possibility that the
exact offending instruction will be unknown, but at least we'll have a
much better idea of where to look.

The downside of course is that this causes system-wide syncs at every
interrupt point which results in significant performance degradation.
Since this situation should not occur in any properly configured system
(as hardware errors are triggered by things like bad pointers), make it a
debug configuration option and disable it by default.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:44 -04:00
Mike Frysinger 97b070c8e7 Blackfin: add note about anomaly 05000242 being worked around
Document anomaly 05000242 workaround in source code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:42 -04:00
Graf Yang 5ba766752d Blackfin: work around anomaly 05000220
When possible, work around anomaly 05000220 (external memory is write
back cached, but L2 is not cached).  If not possible, detect the
conditions at build time and reject any qualifying configurations.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:41 -04:00
Mike Frysinger a261eec000 Blackfin: rename some Blackfin drivers
Try to keep the naming conventions consistent, so:
	SPI_ADC_BF533 -> BFIN_SPI_ADC
	TWI_LCD       -> BFIN_TWI_LCD

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:41 -04:00
Robin Getz a17c7f6f5b Blackfin: make sure MPU CPLB for first 1k is marked as valid
This way we properly catch and kill applications that jump to a NULL ptr.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:40 -04:00
Graf Yang 8af7ffa0d5 Blackfin: add workaround for anomaly 05000287
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:39 -04:00
Graf Yang 1fa9be72b5 Blackfin: add support for gptimer0 as a tick source
For systems where the core cycles are not a usable tick source (like SMP
or cycles gets updated), enable gptimer0 as an alternative.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:37 -04:00
Graf Yang 555487bbb6 Blackfin: annotate anomaly 05000120
Add some notes for anomaly 05000120 to make sure we work around it.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:36 -04:00
Graf Yang ee0263cc2e Blackfin: BF518F-EZBRD: handle required portmuxing of async pins
The two high address lines on the BF51x are not dedicated which means we
need to handle them like any other peripheral pin if we want to access the
upper 2MB of parallel flash.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:35 -04:00
Sonic Zhang 7f3aee3c18 Blackfin: detect anomaly 05000274
Detect and reject operating conditions for anomaly 05000274 since the
problem cannot be worked around in software.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:35 -04:00
Mike Frysinger d8804adf52 Blackfin: do not append newlines to panic() messages
The panic() function already handles newlines for us.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:34 -04:00
Mike Frysinger 729a3fa733 Blackfin: workaround anomaly 05000227
Workaround anomaly 05000227 by only using the scratch pad for stack when
absolutely necessary.  The core code which reprograms clocks really only
touches MMRs directly with constants.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:32 -04:00
Mike Frysinger a9031028ef Blackfin: delete unused sys_getpagesize() function
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:31 -04:00
Graf Yang e522c8466d Blackfin: work around anomaly 05000287
Make sure we work around anomaly 05000287 by configuring different port
preferences for the data cache.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:31 -04:00
Mike Frysinger a9a59e3096 Blackfin: punt useless GPIO init call
This init code existed only to dump a printk(), and not even a useful one.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:30 -04:00
Robin Getz 76068c3c5d Blackfin: annotate anomaly 05000119 in core DMA code
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-12 06:11:29 -04:00
Robin Getz bc4d6f36db Blackfin: document anomaly 05000234 workaround
Note the reason for using CHIPD over DSPID.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:28 -04:00
Robin Getz fecbd7366b Blackfin: fix early L1 relocation crash
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-06-12 06:11:27 -04:00
Graf Yang f5879fda09 Blackfin: add MDMA defines to make cross-variant coding easier
Add some defines to make the BF538/BF561 look like most other Blackfin
parts in that it has a MDMA0 channel available for low level init.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:26 -04:00
Mike Frysinger f339f46b05 Blackfin: fix detection of cached L2 SRAM
Make sure our bfin_addr_dcachable() function flags cached L2 SRAM properly
else memory easily goes unflushed when working with DMA.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12 06:11:25 -04:00