Commit Graph

135 Commits (d2499d8b6c94df02629631807dd96deae7aa7637)

Author SHA1 Message Date
Sam Ravnborg 01ba2bdc6b all archs: consolidate init and exit sections in vmlinux.lds.h
This patch consolidate all definitions of .init.text, .init.data
and .exit.text, .exit.data section definitions in
the generic vmlinux.lds.h.

This is a preparational patch - alone it does not buy
us much good.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-01-28 23:21:17 +01:00
Yi Li ee7883b746 [Blackfin] arch: fix bug kernel boot message: memory information is not reasonable
Some of the information in kernel boot message is not reasonable.
http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3846

 - use _rambase as the start of kernel image.
   kernel is in the region [_rambase, _ramstart]
 - count in pages in per-cpu-page list as available memory
 - reserved memory now include: [0 - 4K] for bad pointer catching,
   memory reserved for abnormaly 05000263, memory reserved by kernel itself.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-27 19:56:17 +08:00
Michael Hennerich 96a5c6f9be [Blackfin] arch: Fix bug - kernel build with Debug option enabled fails to boot up
writes to I/DMEM_CONTROL must be followed by SSYNC

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22 19:23:50 +08:00
Michael Hennerich 444ad82bc3 [Blackfin] arch: Add proper SW System Reset delay sequence
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22 18:38:02 +08:00
Michael Hennerich a2c8cfef6a [Blackfin] arch: GPIO API cleanup and anomaly update
- Add anomaly workaround for bfin_gpio_reset_spi0_ssel1
 - Fix style
 - Update copyright
 - Remove BUG_ON checks for functions intended to be used only by arch
   support. GPIO users should only access using the generic GPIO API
 - Make all GPIO identifier unsigned int

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22 17:20:10 +08:00
Michael Hennerich acbcd26319 [Blackfin] arch: Fix BUG gpio_direction_output API is not compatitable with GENERIC_GPIO API interface
signef-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22 18:36:20 +08:00
Bernd Schmidt b97b8a9983 [Blackfin] arch: Initial checkin of the memory protection support.
Enable it with CONFIG_MPU.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-27 18:39:16 +08:00
Michael Hennerich 2047e40d72 [Blackfin] arch: set_bfin_dma_config shouldnt set SYNC or RESTART by default - add argument or option
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-22 15:29:18 +08:00
Bernd Schmidt 7a1a6d0061 [Blackfin] arch: move all code related to CPLB handling into a new subdirectory under kernel/
Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-11 16:58:44 +08:00
Robin Getz aee3a29240 [Blackfin] arch: print out list of modules if kernel is crashing and tell people if the kernel is tainted
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-11 16:53:00 +08:00
Robin Getz 6b5eace2f1 [Blackfin] arch: Don't oops_in_progress if single step is comming from the kernel
Don't oops_in_progress if single step is comming from the
kernel, which happens if a single step occurs after a exception cause.
This fixes up the remaining issues in the toolchain bug.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-10 17:57:56 +08:00
Michael Hennerich a546b0ac59 [Blackfin] arch: Fix BUG - kernel sometimes would stuck with KEYBOARD_GPIO on
Make sure the SYSTEM reset completes before we issue the CORE reset

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 20:19:51 +08:00
Joe Perches 79f1ec862a [Blackfin] arch: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 20:03:51 +08:00
Michael Hennerich fac3cf432e [Blackfin] arch: Fix gpio label handling
early serial init also utilizes the peripheral request api - however
at this point bfin_gpio_init didn't allocate memory for the labels.
So we always have two zombies (allocated pin functions without labels)

This happens before the initcalls - We now allocate memory statically.
Define MAX_RESOURCES individually for each cpu.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 20:07:03 +08:00
Mike Frysinger 1545a1111a [Blackfin] arch: add support for BF523/BF524/BF526
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 16:54:48 +08:00
Mike Frysinger 54a1668ce5 [Blackfin] arch: scrub dead alive/idle LED code
if it does get re-added, it needs to be in the boards directory,
not common code ... or it needs a re-implementation

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 14:59:03 +08:00
Robin Getz b03b08ba9c [Blackfin] arch: Clean up dump_bfin_mem
Clean up dump_bfin_mem so that it will display
content from the kernel, as well as l1 instruction, when deferred
HW errors happen, print out the last frame info if it makes sense.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-23 22:57:01 +08:00
Robin Getz d8f66c8c1e [Blackfin] arch: fix bug gdb testing on hardware has regression
http://blackfin.uclinux.org/gf/project/toolchain/tracker/?action=TrackerItemEdit&tracker_item_id=3651

As Bernd predicted, this was only necessary because of other
problems in the kenel - fixing those, and this is not necessary, so
remove it.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-12-24 15:27:56 +08:00
Robin Getz 13fe24f37d [Blackfin] arch: fix bug - trap_tests fails to recover on some tests.
http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3719

When the CPLBs get a miss, we do:
  - find a victim in the HW table
  - remove the victim
  - find the replacement in the software table
  - put it into the HW table.

If we can't find a replacement in the software table, we accidently
leave a duplicate in the HW table. This patch ensures that duplicate
is marked as not valid.

What we should do is find the replacement in the software table, before
we find a victim in the HW table - but its too late in the release cycle
to do that much restructuring of this code.

Rather that duplicate code, connect Hardware Errors (irq5) into trap_c,
so user space processes get killed properly.

The rest of irq_panic() can be moved into traps.c (later)

There is still a small corner case that causes problems when a
pheriperal interrupt goes off a single cycle before a user space
hardware error. This causes a kernel panic, rather than the user
space process being killed.

But, this checkin makes things work in 99.9% of the cases, and is a vast
improvement from what is there today (which fails 100% of the time).

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2008-01-27 15:38:56 +08:00
Mike Frysinger 49dce9124b Blackfin arch: split apart dump_bfin_regs and merge/remove show_regs from process.c, which was largely duplicated
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 16:46:49 +08:00
Robin Getz fb322915a0 Blackfin arch: fix bug when sending signals with the wrong PC, cause gdb get confused
We need to send signals with the proper PC, or gdb gets
confused, and lots of tests fail. This should fix that.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 16:38:05 +08:00
Robin Getz 569a50ca3f Blackfin arch: Ensure we printk out strings with the proper loglevel
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 16:35:57 +08:00
Mike Frysinger c3a9f435ae Blackfin arch: cplb and map header file cleanup
- remove duplicated defines for the BF561
 - generalize L2 support (so that it works for BF54x) and mark it executable
 - add support for reading/executing the Boot ROM sections
   (since it has data/functions we may need at runtime)
 - and fixup names for each map

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 16:12:12 +08:00
Mike Frysinger 81a487a59f Blackfin arch: cleanup the cplb declares
- no need to declare their sizes in the common header
 - no need to tack on the section attribute as only the definition matters, not references

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 15:55:45 +08:00
Mike Frysinger 8d6c242062 Blackfin arch: rename _return_from_exception to _bfin_return_from_exception and export it
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 15:53:49 +08:00
Mike Frysinger d0025e5edf Blackfin arch: move EXPORT_SYMBOL() to C files where the symbol is actually defined
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 15:34:51 +08:00
Cliff Cai 28a44d4bd6 Blackfin arch: export symbol get_dma_curr_desc_ptr for driver usage
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-21 15:22:58 +08:00
Robin Getz 90c7f4686f Blackfin arch: cleanup kernel exception message, don't insult the customer.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-18 00:35:33 +08:00
Bernd Schmidt af8a5af3ff Blackfin arch: fix bug kernel not to boot up with mtd filesystems
Revert this patch:
move the init sections to the end of memory, so that after they
are free, run time memory is all continugous - this should help decrease
memory fragementation. When doing this, we also pack some of the other
sections a little closer together, to make sure we don't waste memory.
To make this happen, we need to rename the .data.init_task section to
.init_task.data, so it doesn't get picked up by the linker script glob.

Since it causes the kernel not to boot up with mtd filesystems.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-18 00:09:49 +08:00
Robin Getz 4c26c6c9bf Blackfin arch: print out modules that are loaded if we get a kernel oops
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-18 00:20:49 +08:00
Michael Hennerich 5c91fb902d Blackfin arch: Add assembly function insl_16
/*
 * CPUs often take a performance hit when accessing unaligned memory
 * locations. The actual performance hit varies, it can be small if the
 * hardware handles it or large if we have to take an exception and fix
 * it
 * in software.
 *
 * Since an ethernet header is 14 bytes network drivers often end up
 * with
 * the IP header at an unaligned offset. The IP header can be aligned by
 * shifting the start of the packet by 2 bytes. Drivers should do this
 * with:
 *
 * skb_reserve(NET_IP_ALIGN);
 *
 * The downside to this alignment of the IP header is that the DMA is
 * now
 * unaligned. On some architectures the cost of an unaligned DMA is high
 * and this cost outweighs the gains made by aligning the IP header.
 *
 * Since this trade off varies between architectures, we allow
 * NET_IP_ALIGN
 * to be overridden.
 */

This new function insl_16 allows to read form 32-bit IO and writes to
16-bit aligned memory. This is useful in above described scenario -
In particular with the AXIS AX88180 Gigabit Ethernet MAC.
Once the device is in 32-bit mode, reads from the RX FIFO always
decrements 4bytes.
While on the other side the destination address in SDRAM is always
16-bit aligned.
If we use skb_reserve(0) the receive buffer is 32-bit aligned but later
we hit a unaligned exception in the IP code.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-17 23:46:58 +08:00
Mike Frysinger 1754a5d9f9 Blackfin arch: use do_div() for the 64bit division as pointed out by Bernd
If you need a 64 bit divide in the kernel, use asm/div64.h.
Revert the addition of udivdi3.

Cc: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-23 11:28:11 +08:00
Adrian Bunk 8d2e24c3c1 Blackfin arch: unexport get_wchan
The only user of get_wchan I was able to find is the proc fs - and proc
can't be built modular.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-17 23:05:06 +08:00
Adrian Bunk 05c484355f Blackfin arch: remove dump_thread()
The only user is the a.out support.

It was therefore removed prior to the blackfin merge from all
architectures not supporting a.out.

Currently, Blackfin doesn't suppport a.out.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-18 00:41:56 +08:00
Robin Getz 839e01c2bf Blackfin arch: move the init sections to the end of memory to help decrease memory fragementation
move the init sections to the end of memory, so that after they
are free, run time memory is all continugous - this should help decrease
memory fragementation. When doing this, we also pack some of the other
sections a little closer together, to make sure we don't waste memory.
To make this happen, we need to rename the .data.init_task section to
.init_task.data, so it doesn't get picked up by the linker script glob.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-15 20:57:53 +08:00
Robin Getz 6a3f0b460c Blackfin arch: fix bug cplbmgr.S does not exit properly on error condition
https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=1685

Ensure that cache/protection is turned back on when we get a
fault, and ensure that the initial population of the CPLB tables are
correct - that kernel is locked in CPLB tables

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-15 15:10:48 +08:00
Robin Getz 4a589e1ef6 Blackfin arch: fix bux - only reset the PC when necessary, otherwise gdb gets confused
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-12 22:46:46 +08:00
Robin Getz f26fbc48f1 Blackfin arch: ensure we work around ANOMALY_05000261 for null pointers
We currently do not. Also make it easier to handle cplb violations - in traps.c

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-11-12 22:21:30 +08:00
Mike Frysinger 36208059c1 Blackfin arch: reclaim a few bytes from the end of our init section
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-30 12:00:02 +08:00
Robin Getz 9f336a5326 Blackfin arch: ensure that speculative loads of bad pointers don't cause us to do bad things.
Fix/change formatting of a few more things.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 18:23:28 +08:00
Robin Getz aa770aa790 Blackfin arch: Fix random crash issue found by Michael.
This is fixes a problem where we could jump to the wrong address. By
doing a "p0 = reti; jump (p0)". If a different, higher level interrupt
came in, just before, rather than returning to the calling function, we
would return to a random place in the kernel.

This very elegant fix from Bernd grabs the return location off the
stack, and places it into P0, so when we do a return, it goes to the
correct place.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 18:14:15 +08:00
Robin Getz 7728ec33fa Blackfin arch: fix bug: tell users if the kernel is recovering from a fault condition
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 18:12:15 +08:00
Mike Frysinger 4ad1ec7154 Blackfin arch: add support for checking/clearing overruns in generic purpose Timer API
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 18:02:09 +08:00
Robin Getz 226eb1ef52 Blackfin arch: cleanup arch/blackfin/kernel/traps.c handling code.
- move the CONFIG_KGDB into one block, for easier reading
 - remove printk from printk_address, and pass around buffers. Also
   print out the labels when decoding CPLB errors, so you know exactly
   where the error was.
 - Do not use fixed addresses, becuase people do not know where they come from.
 - Turn the printing level down on the dump, so if you don't want,
   only the signal prints out - just like on other archs. If a kernel/interrupt
   crashes, it should dump everything all the time

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 17:59:07 +08:00
Robin Getz 885be03b06 Blackfin arch: fix bug: kernel prints out error message twice
This fixes two things:
 - stop calling write_lock_irq/write_unlock_irq which can turn modify
   irq levels
 - don't calling mmput when handing exceptions - since this might_sleep,
   which does a rti, and leaves us in kernel space (irq15, rather
   than irq5).

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-29 17:20:41 +08:00
Adrian Bunk 82861924a5 blackfin: fix sg fallout
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <axboe@carl.home.kernel.dk>
2007-10-24 14:09:25 +02:00
Linus Torvalds 6d435365dd Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6:
  Blackfin arch: use KBUILD_CFLAGS and KBUILD_AFLAGS in Makefile
  Blackfin arch: Javier Herrer writes: fix building when icache and dcache is disabled
2007-10-22 19:29:05 -07:00
Jens Axboe 58b053e4ce Update arch/ to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-22 21:19:59 +02:00
Mike Frysinger da27abb799 Blackfin arch: Javier Herrer writes: fix building when icache and dcache is disabled
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-22 10:55:35 +08:00
Bryan Wu 452af71f36 Blackfin arch: dma add some API and cleanup bf54x DMA definition
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
2007-10-22 00:02:14 +08:00