History log of /arch/blackfin/kernel/setup.c
Revision Date Author Comments
f7f4f4dd6948e3bca0e04e5217c825052ad88f5a 10-Dec-2013 Al Viro <viro@zeniv.linux.org.uk> cramfs: take headers to fs/cramfs

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
24a70cf2b28e24aa31c4f9bc310cc274c0a90183 12-Sep-2013 Steven Miao <realmz6@gmail.com> blackfin: scb: Add system crossbar init code.

If SCB exists in select blackfin cpu, developer can change the SCB
priority in kernel configuration.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Steven Miao <realmz6@gmail.com>
13dff62d80e93f1cc65b4ad2dddedd12de720272 18-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> blackfin: delete __cpuinit usage from all blackfin files

The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.

This removes all the arch/blackfin uses of the __cpuinit macros from
all C files. Currently blackfin does not have any __CPUINIT used in
assembly files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Bob Liu <lliubbo@gmail.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
352030530c4b6906a30a8d7dba13bfbf7fbdbdd1 24-Jul-2012 James Cosin <jkosin@intcomgrp.com> blackfin: fix bootup core clock and system clock display

From: James Cosin <jkosin@intcomgrp.com>

fixes the number of digits to 6 after the decimal point to regain the
significant 0s in the frequency after the decimal point.

Signed-off-by: Steven Miao <realmz6@gmail.com>
363737d66427c18edb321a06933ac999d9ce5d7f 31-May-2012 Geert Uytterhoeven <geert@linux-m68k.org> mtd/uclinux: Use generic __bss_stop instead of _ebss

The standard (see BSS_SECTION() in <asm-generic/vmlinux.lds.h> and
<asm-generic/sections.h>) symbol for the end of BSS is __bss_stop.
This allows to remove all local declarations that have been added to
several architectures just to please CONFIG_MTD_UCLINUX.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Greg Ungerer <gerg@uclinux.org>
672552adb3197c5db3acc8800c7917bcff180461 16-May-2012 Steven Miao <realmz6@gmail.com> blackfin: fix build after add bf60x mach/pm.h

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
8bf7135fff46f6ac28baf28a8e4144f685b456a0 15-May-2012 Sonic Zhang <sonic.zhang@analog.com> blackfin: bf60x: Rename the DDR controller macro

Rename the DDR controller macro from DDR0 to DMC0 to avoid confustion for
bf60x.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
1d3dbda6ed0216971291a48531e7b2578ddf7642 17-May-2012 Sonic Zhang <sonic.zhang@analog.com> blackfin: bf60x: cleanup get clock code

Remove redundance code for get clock.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
7c141c1c5c148419eef8972688e86e2e3115ea13 17-May-2012 Bob Liu <lliubbo@gmail.com> blackfin: bf60x: make clock changeable in kernel menuconfig

Add clock changeable support in kernel menuconfig for bf60x.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
592b8785b966ef2841e34a7691026d3aec1ce382 01-May-2012 Mike Frysinger <vapier@gentoo.org> Blackfin: fix unused clk var warning

This is only used on BF60x code (so this patch should get squashed into
the original one that added it).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
b5affb0147cee0ea05d909396f8e389092729236 16-May-2012 Bob Liu <lliubbo@gmail.com> blackfin: add bf60x to current framework

This patch added bf60x to current blackfin kernel framework.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
39429c5e4a2c56a39c9a1c9bdad54431c63104b0 23-Mar-2012 Al Viro <viro@zeniv.linux.org.uk> new helper: ext2_image_size()

... implemented that way since the next commit will leave it
almost alone in ext2_fs.h - most of the file (including
struct ext2_super_block) is going to move to fs/ext2/ext2.h.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
3bed8d67469cc7129b0babc0211c32fa68408ce0 13-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for Blackfin [ver #2]

Disintegrate asm/system.h for Blackfin.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: uclinux-dist-devel@blackfin.uclinux.org
Signed-off-by: Bob Liu <lliubbo@gmail.com>
4dbeccdf7b7573e90b442b6bd896c10c1608e72d 30-Nov-2011 Steven Miao <realmz6@gmail.com> bf54x: get mem size: missing break in switch

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
fb1d9be5967fff0a3c93b06304fd992e3c438b7f 30-May-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: optimize double fault boot checking

This moves the double fault data used at boot time into a single struct
which can then easily be addressed with indexed loads rather than having
to explicitly load multiple addresses.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
fecedc807116ed820ca6f3138d6d47a3bc6c5a60 26-Apr-2011 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Blackfin: convert old cpumask API to new one

old cpu_xxx() APIs is planned to removed later. then, converted.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
00b5c50e47dacd4d288c6b265e00f85711b9ac64 19-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: optimize MMR reads during startup a bit

Since the value of these MMRs aren't changing, store the value in a local
variable and work off of that. This avoids multiple MMR reads which are
implicitly forced by the volatile markings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
6327a574f9ce85f0daab8693913003a456f27f1f 15-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: move internal irq prototypes out of global namespace

These are only used in a few internal Blackfin places, so move the irq
prototypes out of the global header and into the internal irq one. No
functional changes other than shuffling locales.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
3086fd2768fd9276b309722c8f935301e14e8c17 14-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: bf51x/bf52x: fix typo in hysteresis MMR names

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2951acba8510a37c6b56f8481906a809c5eb3b0e 14-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: SMP: drop unused blackfin_cpudata.idle pointer

Not sure when we stopped using this field, but nothing in the tree uses
this now, so punt it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
44491fbc5a228f3c2e61d842fd9fee0bfb839373 14-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: SMP: fix cpudata cache setup

After some cache setup reordering changesets, the blackfin_cpudata init
was left behind. While cpu0's data was correct, cpu1's data was not.
Not that big of a deal as these are only used in the cpuinfo output, but
should still be fixed. So move the setup of these fields to the common
cache setup function to avoid this happening again in the future.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
8d011f70b08f563b007743fd446a6022f0329cd4 13-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: clean up /proc/cpuinfo output

The smp flush lines are too long and have too many newlines, so scale
them back to match the other lines.

The %p modifier shows "(null)" for 0, so use %08x instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
c6345ab1a3d17f4b6c80ac79d7fb0f006b32fdaa 05-Aug-2010 Sonic Zhang <sonic.zhang@analog.com> Blackfin: SMP: work around anomaly 05000491

In order to safely work around anomaly 05000491, we have to execute IFLUSH
from L1 instruction sram. The trouble with multi-core systems is that all
L1 sram is visible only to the active core. So we can't just place the
functions into L1 and call it directly. We need to setup a jump table and
place the entry point in external memory. This will call the right func
based on the active core.

In the process, convert from the manual relocation of a small bit of code
into Core B's L1 to the more general framework we already have in place
for loading arbitrary pieces of code into L1.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7a4a207e74d6aeb63a38e9a3f0cfc40223d5c40e 05-Jul-2010 Michael Hennerich <michael.hennerich@analog.com> Blackfin: BF51x/BF52x: support GPIO Hysteresis/Schmitt Trigger options

Newer parts have optional Hysteresis/Schmitt Trigger options to help with
dirty signals. So add some kconfig options for tuning this and enable it
by default for people.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
be1577e3787536290cc17afaeb2cd58bbcc7ed6c 10-May-2010 Mike Frysinger <vapier@gentoo.org> Blackfin: another year of changes (update copyright in boot log)

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
718340f62900ed44046d2b0f74d0dec7cf844194 01-Feb-2010 Graf Yang <graf.yang@analog.com> Blackfin: rewrite resync_core_{i,d}cache() SMP logic to avoid per_cpu data

This functions are implicitly called by core functions like cpu_relax(),
and since those functions may be called early on before common code has
initialized the per-cpu data area, we need to tweak the stats gathering.
Now the statistics are maintained in common bss which makes these funcs
safe to use as soon as the C runtime env is setup.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
d86bfb1600db38e8387beee0aaab4263cfd728a2 07-Jan-2010 Barry Song <barry.song@analog.com> Blackfin: initial XIP support

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
6feda3a6530204ad73a2dc1713c051462a1d9c49 05-Jan-2010 Barry Song <barry.song@analog.com> Blackfin: replace harcoded define with proper THREAD_SIZE macro

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
e18e7dd33454f277b9438af66d25984362278021 07-Dec-2009 Barry Song <barry.song@analog.com> Blackfin: fix MPU page permission masks overflow when dealing with async memory

Attempting to use the MPU while doing XIP out of parallel flash hooked up
to the async memory bus would often result in random crashes as the MPU
slowly corrupted memory.

The fallout here is that the async banks gain MPU protection from user
space too. So any accesses have to go through the mmap() interface rather
than just using hardcoded pointers.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
b635f1912da764c960c044ffd58ba27157aa2c85 23-Sep-2009 Sonic Zhang <sonic.zhang@analog.com> Blackfin: allow boards to register early devices

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
d45e8db1b20c510a189d769d877af2e8e9df985f 27-Nov-2009 Barry Song <barry.song@analog.com> 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>
7a1a8cc1902af3a2a19636da3674008b2f1246db 20-Oct-2009 Robin Getz <robin.getz@analog.com> 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>
5cd82a6d58cb14c3a5d08ed171229de7adc3deac 23-Sep-2009 Mike Frysinger <vapier@gentoo.org> 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>
96f1050d3df105c9ae6c6ac224f370199ea82fcd 24-Sep-2009 Robin Getz <robin.getz@analog.com> 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>
05d17dfaab6671def3fcdcd95c39fd49924dbb3b 21-Aug-2009 Michael Hennerich <michael.hennerich@analog.com> Blackfin: fix spelling in a few comments

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
3aa670419a02b19a2168894f7edbb5e4b9e4e607 14-Aug-2009 Mike Frysinger <vapier@gentoo.org> 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>
837ec2d56c41640d1f1238e52c350b2a516d29ba 07-Jul-2009 Robin Getz <robin.getz@analog.com> 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>
3f871feaf3390c6d6e578818f867917c2e4738a2 06-Jul-2009 Robin Getz <robin.getz@analog.com> 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>
2f812c0bd5ee1d9c145fb1c3523ecdf45e05f8ce 26-Jun-2009 Robin Getz <robin.getz@analog.com> 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>
c70c754ff916cedd969a73549799d2167ffefcd6 09-Jul-2009 Michael Hennerich <michael.hennerich@analog.com> 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>
3a920accbb5f88d753ab5a6a47d0dd48b6269f84 06-Jul-2009 Robin Getz <robin.getz@analog.com> 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>
dc437b1b596e310bb583de3868c3d61a6798c81c 26-Jun-2009 Robin Getz <robin.getz@analog.com> 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>
b2dc0a08845af9d6ea990a1a28d4545998707570 20-Jun-2009 Mike Frysinger <vapier@gentoo.org> 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>
ad361c9884e809340f6daca80d56a9e9c871690a 06-Jul-2009 Joe Perches <joe@perches.com> Remove multiple KERN_ prefixes from printk formats

Commit 5fd29d6ccbc98884569d6f3105aeca70858b3e0f ("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>
bd854c077e660b5f44b5049219645042bcba61ac 19-Jun-2009 Robin Getz <robin.getz@analog.com> 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>
41ba653f24a39a0e6a4afe9b2763a95a57e042c2 16-Jun-2009 Jie Zhang <jie.zhang@analog.com> 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>
0de4adfb8c9674fa1572b0ff1371acc94b0be901 15-Jun-2009 Sonic Zhang <sonic.zhang@analog.com> 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>
47e9dedb720364e0adff0e99960fa294c6161f71 10-Jun-2009 Sonic Zhang <sonic.zhang@analog.com> 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>
2466ac65560ee8b7506eea3987aba9519355fd02 08-Jun-2009 Robin Getz <robin.getz@analog.com> 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>
79df1b69471b5ea4be8285c9dc6ab05cdf5a85d7 27-May-2009 Mike Frysinger <vapier@gentoo.org> 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>
7f3aee3c187641ec7c7e260d9cabb71ac4ac9f7c 07-May-2009 Sonic Zhang <sonic.zhang@analog.com> 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>
d8804adf52f5991388fa9af77428e4cc7768059d 29-Apr-2009 Mike Frysinger <vapier@gentoo.org> Blackfin: do not append newlines to panic() messages

The panic() function already handles newlines for us.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
fecbd7366bf5a39eaae2c03541f0b412f319534f 23-Apr-2009 Robin Getz <robin.getz@analog.com> 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>
27276ba21fe590edc43305f483565aa02010bbbb 05-Mar-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: remove spurious dash when dcache is off

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
00049522425e8390d1815e1579733644ad2bb0c7 05-Mar-2009 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: Random read/write errors are a bad thing

Random read/write errors are a bad thing - so don't let anyone
(including the test bench) run on something we know is bad.

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
972de7d9292439c9429c301cf377fbf56b6e654e 04-Feb-2009 Michael Hennerich <michael.hennerich@analog.com> Blackfin arch: Update Copyright information

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
af4c7d4b4eddc297bbb516abdd6154bffc8e05e5 04-Feb-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: define bfin_memmap as static since it is only used here

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
ed1fb6048c3eef68df5fe19e9022fdad6e53357d 04-Feb-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: read SYSCR on newer parts that mirror the bits of SWRST in it

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
76e8fe4da652b020e08089415c684a365bb5b6a9 04-Feb-2009 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: Print out where the bootmode is coming from (for easier debugging).

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
e32f55d9dbffd2ca16e0bb4ea7156b56741b78cd 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: rewrite get_sclk()/get_vco()

rewrite get_sclk()/get_vco() based on the assumption sclk/vco never
changes (since today it cannot)

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
dbdf20db537a5369c65330f878ad4905020a8bfa 07-Jan-2009 Bernd Schmidt <bernds_cb1@t-online.de> Blackfin arch: Faster C implementation of no-MPU CPLB handler

This is a mixture ofcMichael McTernan's patch and the existing cplb-mpu code.

We ditch the old cplb-nompu implementation, which is a good example of
why a good algorithm in a HLL is preferrable to a bad algorithm written in
assembly. Rather than try to construct a table of all posible CPLBs and
search it, we just create a (smaller) table of memory regions and
their attributes. Some of the data structures are now unified for both
the mpu and nompu cases. A lot of needless complexity in cplbinit.c is
removed.

Further optimizations:
* compile cplbmgr.c with a lot of -ffixed-reg options, and omit saving
these registers on the stack when entering a CPLB exception.
* lose cli/nop/nop/sti sequences for some workarounds - these don't
* make
sense in an exception context

Additional code unification should be possible after this.

[Mike Frysinger <vapier.adi@gmail.com>:
- convert CPP if statements to C if statements
- remove redundant statements
- use a do...while loop rather than a for loop to get slightly better
optimization and to avoid gcc "may be used uninitialized" warnings ...
we know that the [id]cplb_nr_bounds variables will never be 0, so this
is OK
- the no-mpu code was the last user of MAX_MEM_SIZE and with that rewritten,
we can punt it
- add some BUG_ON() checks to make sure we dont overflow the small
cplb_bounds array
- add i/d cplb entries for the bootrom because there is functions/data in
there we want to access
- we do not need a NULL trailing entry as any time we access the bounds
arrays, we use the nr_bounds variable
]

Signed-off-by: Michael McTernan <mmcternan@airvana.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
7419a327f6264bef869b195497aaf03b72ca17b7 07-Jan-2009 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: panic when running on a chip rev below what we are compiled for

If we are running on a chip revision below what we are compiled for,
there will be missing anomaly workarounds, and a panic is inevitable. Do
is sooner, rather than later, so people don't look for bugs that already
have workarounds (that they turned off).

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
508808cda6c39819f51b58e95ba5c6222acea222 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: do not allow people to pass in a diff clkin_hz value

do not allow people to pass in a diff clkin_hz value when
reprogramming clocks -- it is too late currently

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
7f1e2f98bd29f51edd64e0c15b10d9a18a7af4e1 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: allow clkin_hz to be specified on the command line

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
275123e8ab59ee6379dcccbd05c5fcc418801b64 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: show_cpuinfo - consolidate ugly casts

rather than use *(unsigned int *)v everywhere, do this once with a local
cpu_num variable

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
259fea42e66e62226c310a6646049b99912af7cc 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: include linux/mm.h since we use PAGE_ALIGN and such

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
dd3dd384df7f9f77fba6875a606e5a663510cd1d 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: rewrite dma_memcpy() and dma in/out functions

- unify all dma in/out functions (takes ~35 lines of code now)
- unify dma_memcpy with dma in/out functions (1 place that touches MDMA0
registers)
- add support for 32bit transfers
- cleanup dma_memcpy code to be much more readable
- irqs are disabled only while programming MDMA registers rather than
the entire transaction

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
1ea9925553caad6ea5068b4652596f149e0be9c3 07-Jan-2009 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: delete now unused "cclk" member of blackfin_cpudata

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
a5f0717e51c5fe6cdaf885b7f621ba48ae745bfb 18-Nov-2008 Michael Hennerich <michael.hennerich@analog.com> Blackfin arch: Fix bug - change cpufreq doesn't take effect on bf537 now

CCLK is variable: get current CCLK in show_cpuinfo

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
8f65873e47784a390949f0d61e5692dbf2a8253e 18-Nov-2008 Graf Yang <graf.yang@analog.com> Blackfin arch: SMP supporting patchset: Blackfin kernel and memory management code

Blackfin dual core BF561 processor can support SMP like features.
https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like

In this patch, we provide SMP extend to Blackfin kernel and memory management code

Singed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
da986b9ffff79224417b69cf43506192bd9c29dc 28-Oct-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: dont warn when running a kernel on the oldest supported silicon

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
3b1f26a50a2bfbd2825345b49b1d7f78432a7a4c 27-Oct-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: don't copy bss when copying L1

when copying L1 regions, go to the start of bss rather
than end since we have code to zero it out already

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
58c35bd31f8b577e03d904c214b55b3d91369a85 13-Oct-2008 Vitja Makarov <vitja.makarov@gmail.com> Blackfin arch: introducing bfin_addr_dcachable

This patch introduces bfin_addr_dcachable() predicate, that simply tests is
address in cachable region or not.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
3094c981f2d567f0a442687ced24a5340aa10b6c 10-Oct-2008 Bryan Wu <cooloney@kernel.org> Blackfin arch: fix a typo in comments

Signed-off-by: Bryan Wu <cooloney@kernel.org>
e482cad241c0b7108cbc94959307a73d19ba17d5 10-Oct-2008 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: print out error/warning if you are running on the incorrect CPU type

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
0c0497c257c12c9ecb8825490a339bfce8a0532f 09-Oct-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: Move all the silicon rev handling to one place

Move all the silicon rev handling to one place (Kconfig) and
make sure we warn if you are running on silicon that has not been tested on

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
55f2feae3a1e075d9b4b0e73a6024f3e25717878 09-Oct-2008 Graf Yang <graf.yang@analog.com> Blackfin arch: correct icache size in show_cpuinfo(), let c_start() return proper pointer

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
5b04f271fe49bb7adb061de454d383c027a18de0 08-Oct-2008 Graf Yang <graf.yang@analog.com> Blackfin arch: Modify some funtion names to more genernal ones

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
0c7a6b2135c1bcb5139ca9ca87f292caafcb9410 08-Oct-2008 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: add supporting for double fault debug handling

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
c991dd92ab150c0b4ba531105aad5612bb0dafba 14-Aug-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: use %pF when printing out the double fault address so we get symbol names

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
cd8fb8df1458df7f3b99fd112e722b05f42c64d9 14-Aug-2008 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: Print out doublefault addresses, so debug can occur

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
0e06b50dda5965e0f8a15b0be14b759ead54fd2a 14-Aug-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: cleanup cache lock code

- remove cheesy read_iloc() function
- move invalidate_entire_icache function to lock.S
- export proper prototypes for functions in lock.S
- only build lock.S when BFIN_ICACHE_LOCK is enabled

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
07aa7be5708afb3d9afa68f6f853c98e51bc64b3 13-Aug-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: convert L2 defines to be the same as the L1 defines

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
7e64acabfdb530b1b7d3db2592d75d102827baf3 06-Aug-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: move async memory programming into common setup_arch() as the banks dont really need to be setup fully as early as head.S

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
2d2009806dd843f3adc0cbbb5d2204980f28111a 26-Jul-2008 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: If we double fault, rather than hang forever, reset

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
9de3a0b6979a4839d67ca840e386ea06acaabe39 26-Jul-2008 Robin Getz <rgetz@blackfin.uclinux.org> Blackfin arch: When icache is off, make sure people know it

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
3a2521fa75359450f5ec7e6b76847f933b7ee680 26-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: cache the values of vco/sclk/cclk as the overhead of doing so (~24 bytes) is worth avoiding the software mult/div routines

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
b1b154e503a0e590eb9e189586783dc8750f910e 26-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> Blackfin arch: check the EXTBANKS field of the DDRCTL1 register to see if we are using both memory banks

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
262c3825a9f3eb0f4f30ebb4b1ee57397bcb3ffc 19-Jul-2008 Sonic Zhang <sonic.zhang@analog.com> Blackfin arch: Extend sram malloc to handle L2 SRAM.

Extend system call to alloc L2 SRAM in application.
Automatically move following sections to L2 SRAM:
1. kernel built-in l2 attribute section
2. kernel module l2 attribute section
3. elf-fdpic application l2 attribute section

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
99d95bbd48f43dafdcd0540eb0da26c5655d7f33 14-Jul-2008 Michael Hennerich <michael.hennerich@analog.com> Blackfin arch: Remove redundant kernel option

use kernel command line mem and max_mem bootargs to limit
availabe memory instead.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
1e78042c77dcc255abd456398981549269c63238 24-Apr-2008 Michael Hennerich <michael.hennerich@analog.com> [Blackfin] arch: take DDR DEVWD into consideration as well for BF548

Pointed-out-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
37b6972ad8fb08d438fd600888aff212b1b193b0 24-Apr-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: BF54x memsizes are in mbits, not mbytes

Pointed-out-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
a086ee2268abcfcbf80a114f4602e5b26aa80bf0 24-Apr-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: detect the memory available in the system on the fly by default

detect the memory available in the system on the fly by default
rather than forcing people to set this manually in the kconfig

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
9f8e895d6cc2f871bca6df2ad6791671de2adeae 24-Apr-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: now that we can panic() early, dont need the delayed L1 overflow check

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
b85b82d980526d683dc3b39f2ac1f447fa84a105 24-Apr-2008 Sonic Zhang <sonic.zhang@analog.com> [Blackfin] arch: fix bug - Section data_l1_cacheline_aligned should be defined in link script of kernel

http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3978

Section data_l1_cacheline_aligned should be defined in
link script of kernel, when L1 data sram bank A is not available.

In bf536 with all data cache is enabled, there is no L1 data sram.
Current link script won't define section data_l1.cacheline_aligned in
this case. But, if user select put cacheline_aligned data into l1 sram
in kernel menuconfig, these data will be dropped and access to these
data will trigger data CPLB exception.

Do panic in l1 relocation code as well.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
253bcf4f9b6dde1cfa169bc29655cf177d6a903b 23-Apr-2008 Robin Getz <rgetz@blackfin.uclinux.org> [Blackfin] arch: Add a little bit more runtime info for MPU

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
3132b58679261ee0edfda3a846539bb1b0750705 23-Apr-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: theres no need to declare ram{end,start,base} in the head.S files

theres no need to declare ram{end,start,base} in the head.S files
when declaring them with the other memory related variables in setup.c
is so much simpler/nicer

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
2e8d7965e69a4879f9331d35b13ce234a3df4a04 26-Mar-2008 Yi Li <yi.li@analog.com> [Blackfin] arch: add code to initialize globals declared in linux/bootmem.h: max_pfn, max_low_pfn, min_low_pfn.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
03a44825be987d720df854f63b2f7bd30e46bdde 08-Feb-2008 Jan Engelhardt <jengelh@computergmbh.de> procfs: constify function pointer tables

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-By: David Howells <dhowells@redhat.com>
Acked-by: Bryan Wu <bryan.wu@analog.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
72a7fe3967dbf86cb34e24fbf1d957fe24d2f246 07-Feb-2008 Bernhard Walle <bwalle@suse.de> Introduce flags for reserve_bootmem()

This patchset adds a flags variable to reserve_bootmem() and uses the
BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions
between crashkernel area and already used memory.

This patch:

Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE.
If that flag is set, the function returns with -EBUSY if the memory already
has been reserved in the past. This is to avoid conflicts.

Because that code runs before SMP initialisation, there's no race condition
inside reserve_bootmem_core().

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: <linux-arch@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
c0eab3b784ffdd3912450c7654c75bbcc0270ee8 02-Feb-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: fix building with mtd uclinux by putting the mtd_phys option into the function it actually gets used in

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
550d553838b5369efba9e51520c85dbd03371cc8 02-Feb-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: simpler header and update dates

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
b7627acc432a36072253bb1288f56e78c7d9423e 02-Feb-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: move the init sections to the end of memory

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: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
6cda2e90588ba2f70543abf68b4815e10c86aef1 02-Feb-2008 Michael Hennerich <michael.hennerich@analog.com> [Blackfin] arch: Fix BUG - Enable ISP1362 driver to work ok with BF561

This fixes a bug (zero pointer access) only seen on BF561, during USB
Mass Storage/SCSI Host initialization.

It appears to be related to registering a none existing CPU

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
856783b37a958086c83ea44544d366affd0c2c4b 08-Feb-2008 Yi Li <yi.li@analog.com> [Blackfin] arch: add "memmap=nn[KMG]@ss[KMG]" and "memmap=nn[KMG]$ss[KMG]" options to blackfin, based on arch/i386/kernel/e820.c

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
d45118b14bf04e124e4d875b136d5c1c4df97d57 24-Feb-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: make sure we export the _bfin_swrst symbol as modules (like the watchdog) need it

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
8929ecf84df529338d258f0ad9c1e553dfc921bc 22-Feb-2008 Mike Frysinger <vapier.adi@gmail.com> [Blackfin] arch: add fixed code to the memory map output

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
af8a5af3ff73055f7554a3a66307ad58792f09d5 17-Nov-2007 Bernd Schmidt <bernd.schmidt@analog.com> 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>
1754a5d9f97f16f729066b8f125351af4951d6fe 23-Nov-2007 Mike Frysinger <michael.frysinger@analog.com> 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>
ee7883b7466e721a72edacbcba2fe9cf449d82b2 27-Jan-2008 Yi Li <yi.li@analog.com> [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>
b97b8a998397e8c64699559099fa9febffae2b4d 27-Jan-2008 Bernd Schmidt <bernd.schmidt@analog.com> [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>
54a1668ce53fe701f1d36651b591ced388e97275 24-Dec-2007 Mike Frysinger <michael.frysinger@analog.com> [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>
839e01c2bfba34f97ec36d0d355801e94254ffd5 15-Nov-2007 Robin Getz <robin.getz@analog.com> 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>
9f336a53266f43ae1002f4aaad5373944589c828 29-Oct-2007 Robin Getz <robin.getz@analog.com> 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>
7728ec33faf88605fb871b9b0ecf8e45d4359678 29-Oct-2007 Robin Getz <robin.getz@analog.com> 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>
da27abb79970e80904818e3866703ed02953a174 22-Oct-2007 Mike Frysinger <michael.frysinger@analog.com> 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>
2f6cf7bfc64c44d760d53caf4b547e7729392e78 21-Oct-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: add functions for converting between sclks and usecs

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
066954a3891d32198edad3b319792d8db6a6a575 21-Oct-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: use "char bfin_board_name[]" rather than "char *bfin_board_name" per discussion on lkml as the former uses less storage

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
73b0c0b0c1fa06acc3a02a58f301b0db0818d3d0 21-Oct-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: Fix up /proc/cpuinfo so it is like everyone else

Fix up /proc/cpuinfo so it is like everyone else, and gets
parsed by various applications properly. Still needs some tweaking on
parts without full L1 sram, like 532, 531, so it doesn't print out L1
bank info that doesn't exist.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
ce3afa1c043ab3d4125671441a57353d80f5f6f7 09-Oct-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: Enable earlyprintk earlier - so any error after our interrupt tables are set up will print out

Also ensure that the traps_c code doesn't cause a double fault, by
sending a signal to a faulting kernel before the memory subsystem
is fully initialized, by printing out the error message before sending
the signal.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
b5c0e2e8068ca31eb2547f2e2e677516ce9d8800 12-Sep-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: fix typo pointed out by David Rowe (Mhz -> MHz)

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
02f13f9d5c1d3104c5c4e7f4ae30c43d595d1d75 27-Aug-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: Remove cruft - CONFIG_DEBUG_SERIAL_EARLY_INIT didn't work that well with DEBUG_KERNEL_START

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
3bebca2d20796dd3dc62c5d3e74148087c7ce5bd 10-Oct-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: to do some consolidation of common code and common name spaces

now all BLKFIN should be BFIN, should be no functional changes.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
1aafd9091226a02b481298315f959f777294684e 25-Jul-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: revise anomaly handling by basing things on the compiler not the kconfig defines

revise anomaly handling by basing things on the compiler not the kconfig defines,
so the header is stable and usable outside of the kernel. This also allows us to
move some code from preprocessing to compiling (gcc culls dead code)
which should help with code quality (readability, catch minor bugs, etc...).

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
8be80ed3f74a60e1af5a30e6b4fa4f744911676e 25-Jul-2007 Bernd Schmidt <bernd.schmidt@analog.com> Blackfin arch: Initialize the exception vectors early in the boot process

Initialize the exception vectors early in the boot process, so that CPLB faults
can be handled when memory protection is enabled.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
e5b6bd61f2b38fbadf72ea7835ee1b1de6d7530b 24-Jul-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: use bfin_read_SWRST() now that BF561 provides it

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
34e0fc89bdc1e6f50032dc43ed23167f5dbad6da 12-Jul-2007 Michael Hennerich <michael.hennerich@analog.com> Blackfin arch: Enable BF54x PIN/GPIO interrupts

Signed-off-bu: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
1f83b8f148a1eb967d2a628cbb741cd56fb54572 12-Jul-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: cleanup warnings from checkpatch -- no functional changes

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
de3025f4e2bc063c274f561f9daf2b696910ad3b 25-Jun-2007 Jie Zhang <jie.zhang@analog.com> Blackfin arch: Add proper -mcpu option according to the cpu and silicon revision configuration

Add silicon revision "any" and "none". Add proper -mcpu option according
to the cpu and silicon revision configuration.

Need update to use latest Blackfin cross compile toolchain.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
669b792c77bbc30e9f4d9c95dbc918dc348c49c2 21-Jun-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: Clean up trace buffer handling, No major functional changes.

Turns on trace earlier, so crashes at kernel start should print out a
trace, making things easier to debug.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
29440a2b4cd37e32dfe0fa60ef1665775b24dab1 12-Jul-2007 Bernd Schmidt <bernd.schmidt@analog.com> Blackfin arch: Start untangling the CPLB handling code.

- Move cache initialization to C from assembly.
- Move anomaly workaround for writing [ID]MEM_CONTROL to assembly, so
that we don't have to mess around with .align directives in C source.
- Fix a bug where bfin_write_DMEM_CONTROL would write to IMEM_CONTROL
- Break out CPLB related code from kernel/setup.c into their own file.
- Don't define variables in header files, only declare them.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
7adfb58fbd0a27469d26536f99b66391c4c8e2a0 21-Jun-2007 Bernd Schmidt <bernd.schmidt@analog.com> Blackfin arch: defines and provides entry points for certain user space functions at fixed addresses

This patch defines (and provides) entry points for certain user space functions
at fixed addresses. The Blackfin has no usable atomic instructions, but we can
ensure that these code sequences appear atomic from a user space point of view
by detecting when we're in the process of executing them during the interrupt
handler return path. This allows much more efficient pthread lock
implementations than the bfin_spinlock syscall we're currently using.

Also provided is a small sys_rt_sigreturn stub which can be used by the signal
handler setup code. The signal.c part will be committed separately.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
24a07a124198153540f8f43d9e91d16227aba66e 12-Jul-2007 Roy Huang <roy.huang@analog.com> Blackfin arch: initial supporting for BF548-EZKIT

The ADSP-BF54x was specifically designed to meet the needs of convergent multimedia
applications where system performance and cost are essential ingredients. The
integration of multimedia, human interface, and connectivity peripherals combined
with increased system bandwidth and on-chip memory provides customers a platform to
design the most demanding applications.

Since now, ADSP-BF54x will be supported in the Linux kernel and bunch of related drivers
such as USB OTG, ATAPI, NAND flash controller, LCD framebuffer, sound, touch screen will
be submitted later.

Please enjoy the show.

Signed-off-by: Roy Huang <roy.huang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
86b73c8cfc8daeff554ae3e95e2a0ee77c45d499 21-Jun-2007 Robin Getz <robin.getz@analog.com> Blackfin arch: match kernel startup messaage with new linker script

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
5e10b4a653b9c7942fd1044fe5b592d544736897 11-Jun-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: add support for Alon Bar-Lev's dynamic kernel command-line

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
5af4c2b367c9c3dcc0cb02880df3a8581bb12a87 14-Jun-2007 Aubrey Li <aubrey.li@analog.com> Blackfin arch: try to split up functions like this into smaller units according to LKML review

Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
52a078120c33b06a9abb721357adaafc3b55b7c1 11-Jun-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: move more of our startup code to .init so it can be freed once we are up and running

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
a9c59c2746c7e773839d51027c0e16ccf41f8fef 21-May-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: cache SWRST value at bootup so other things like watchdog can non-destructively query it

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
c0fc525dcc407a516132fc11af82375319ebdadb 21-May-2007 Mike Frysinger <michael.frysinger@analog.com> Blackfin arch: move board specific setup out of common init code and into the board specific init code

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6e537e9329d133526a576b741f85b3d48edc4ac1 21-May-2007 Michael Hennerich <michael.hennerich@analog.com> Blackfin arch: Fix bug using usb keyboard crashes kernel

Without conswitchp preset, we have the following situation:

- During initcalls: con_init is called, and returns because of
!display_desc.

- At this point there is no memory allocated for vc_cons[].d
A bit later vty_init calls kbd_init.

- From now on events are passed to kbd_event which will then call
kbd_keycode.

- kbd_keycode will oops on a NULL pointer dereference on vc->vc_tty

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
[ Added commit description based on email thread. - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1394f03221790a988afc3e4b3cb79f2e477246a9 06-May-2007 Bryan Wu <bryan.wu@analog.com> blackfin architecture

This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.

The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.

The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf

The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc

This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/

We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel

[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>