Commit Graph

30 Commits

Author SHA1 Message Date
Sam Ravnborg 881e02d298 sparc32: drop swapper_pg_dir
We save one page of RAM dropping swapper_pg_dir.
It was only used for an assignment in init-mm.c and we
redid this later in srmmu.c anyway.

This is likely a left-over from the sun4c removal.

To avoid a dummy variable we use a simple #define swapper_pg_dir NULL

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-26 16:46:15 -07:00
Sam Ravnborg 4fd8bc6718 sparc32: remove unused variable in head_32.S
It was assigned, but never referenced later.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-29 12:47:37 -07:00
Sam Ravnborg 1ddb22e13d sparc32,leon: fix leon bootup
head_32.S failed to set cputypval for leon, causing boot to fail.
The boot failed because we failed to recognize this was a LEON
cpu so we did not preoperly run-time patch the the kernel.
This resulted in an early crash.

Reported-by: Daniel Hellstrom <daniel@gaisler.com>
Tested-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Eisele <konrad@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-29 12:47:36 -07:00
Sam Ravnborg 3107948848 sparc32,leon: always include leon_smp + leon_mm in build
Fix-up leon specific assembler to use ASI_LEON_MMUREGS

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-27 23:52:47 -07:00
Sam Ravnborg 4efb55e691 sparc32: introduce sparc32_start_kernel called from head_32.S
This gives us a C hook before we call start_kernel()

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2012-05-27 23:52:42 -07:00
Sam Ravnborg 30005efc98 sparc32: implement proper LEON support in head_32 (after highmem)
We use the compatibility property to determine the
sun models. For leon we use psr.impl and ignore the
result of the getprops call.

Include a hack to allow build as the support code
is not yet converted.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-27 23:52:41 -07:00
Sam Ravnborg 7b372d6582 sparc32: implement proper LEON support in head_32 (before highmem)
Use PSR to check if the CPU is LEON and jump to
LEON specific code in this case.

Added a few constants to psr.h to increase readability.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
2012-05-27 23:52:41 -07:00
Sam Ravnborg ec24158eac sparc32: string and whitespace cleanup in head_32.S
A few strings have been adopted to show more relevant info.

Julian Calaby <julian.calaby@gmail.com> pointed out one
that I would otherwise have missed.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2012-05-27 23:52:40 -07:00
Sam Ravnborg c64d7524b5 sparc32: move trap table to a separate file
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-19 23:27:25 -07:00
David S. Miller 837ebf0ec7 sparc32: Kill boot_cpu_id4
It is written, but never actually read.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-19 21:40:50 -07:00
David S. Miller 1b35a57b1c sparc32: Kill off software 32-bit multiply/divide routines.
For the explicit calls to .udiv/.umul in assembler, I made a
mechanical (read as: safe) transformation.  I didn't attempt
to make any simplifications.

In particular, __ndelay and __udelay can be simplified significantly.
Some of the %y reads are unnecessary and these routines have no need
any longer for allocating a register window, they can be leaf
functions.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-15 11:23:47 -07:00
David S. Miller c7020eb466 sparc32: Remove cypress cpu support.
It's the one aberration in v8, the only cpu that
didn't actually have hardware multiply and divide
instructions.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
2012-05-15 10:22:00 -07:00
Sam Ravnborg d6ea55733d sparc32: simpler cputype check in head_32.S
We know this is not a sun4/sun4c - as we checked earlier.
So no need to repeat the check.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12 11:32:00 -07:00
Sam Ravnborg eb06f47630 sparc32: drop extra getprop call during boot
It was present only to support the sun4, sun4c boxes which
do not have the "compatible" property in the root-node
of the device tree.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12 11:32:00 -07:00
Sam Ravnborg 142cc039bd sparc32: drop prom version check in head_32.S
We already sorted out if we are a sun4/sun4c and halted.
So no need to check the prom version as we know this is
a v2 or v3 as sun4m, sun4d etc. does not use a v1 prom.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12 11:31:59 -07:00
Sam Ravnborg 1b4cb70ec8 sparc32: remove sun4c specific variables from head_32.S
This gives us back 7 pages...

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12 11:31:58 -07:00
David S. Miller 9b4c514ad2 sparc32: Add back early sun4/sun4c detection so we can warn properly.
We need to do the check before we try to remap the kernel using
SRMMU operations.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-12 01:02:11 -07:00
David S. Miller 96061a91a1 sparc32: Restore SMP build and rectify sun4m NMI when non-SMP.
The non-SMP sun4m NMI handler was still accessing SUN4C registers.

Fix that and share the sun4m NMI trap code between SMP and non-SMP
cases.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-11 21:23:05 -07:00
Sam Ravnborg 323206a1d5 sparc32: drop sun4c bits from head_32.S
As we no longer support sun4c we can remove all the code to
support remapping the kernel in head_32.S.
We also try to tell the user that the machine is not support,
in case someone try to boot the kernel on a sun4c one day

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-11 19:29:00 -07:00
Sam Ravnborg 306f123162 sparc32: remove sun4c traps
We used to runtime patch the trap table for srmmu.
With the removal of sun4c support this is no longer required.

With the sun4c trap removed we can remove all the referenced
trap handling which is sun4c specific.
This also allows us to get rid of the nosun4c.c file that
contained only dummy functions/data.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-11 19:27:46 -07:00
Sam Ravnborg 2c1cfb2db6 sparc32: drop sun4c support
Machines with sun4c support are very rare these days, and noone
is using them for any practical purposes.
The sun4c support has been know broken for quite some time too.

So rather than trying to keep it up-to-date, lets get rid of it.
This allows us to do some very welcome cleanup of sparc32 support.

Updated the former sun4c specifc nmi (which was also used
for sun4m UP) to be a generic UP NMI.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-11 19:27:44 -07:00
Daniel Hellstrom 01dae0f08d sparc32,leon: operate on boot-cpu IRQ controller registers
* proper initialization of boot_cpu_id (no hardcoding to 0)
 * use boot_cpu_id index to address into the IRQ controller where
   appropriate

Each CPU has a separate set of IRQ controller registers, this
patch makes sure that the boot-cpu registers are used instead
of CPU0's.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-04-21 16:44:45 -07:00
Daniel Hellstrom 5fcafb7a23 sparc32: always define boot_cpu_id
Define boot_cpu_id in single-processor kernels as well. This is
to support architectures which can boot on other than CPU0.

Sam Ravnborg has written the cleanup parts by extracting
boot_cpu_id from smp_32.c into setup_32.c and cleaned up
sun4d_irq.c.

boot_cpu_id was initialized before BSS was cleared in
sun4c_continue_boot, instead boot_cpu_id is set to 0xff to
avoid BSS. If boot_cpu_id is untouched (0xff) by bootup code
it will be overwritten to 0. boot_cpu_id4 is automatically
calculated in common code.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-04-21 16:44:44 -07:00
Sam Ravnborg b2a39b0d8e sparc: use _start for the start entry (like 64 bit does)
We use "_start" in 64 bit - do the same in 32 bit.
It is always good to be consistent.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-04 19:25:04 -08:00
Konrad Eisele 8401707ff6 sparc,leon: Sparc-Leon SMP support
Support SMP for a Sparc-Leon multiprocessor system.
Add Leon specific SMP code to arch/sparc/kernel/leon_smp.c.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-02 04:19:42 -08:00
Konrad Eisele 0fd7ef1fe0 sparc,leon: Introduce the sparc-leon CPU type.
Add sparc_leon enum, M_LEON|M_LEON3_SOC machine. Add compilation of
leon.c in mm and kernel
if CONFIG_SPARC_LEON is defined. Add sparc_leon dependent
initialization to switch statements + head.S.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by:   Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-17 18:32:10 -07:00
Tim Abbott a0871e8cb8 sparc: cleanup references to deprecated .text.init* sections.
The section .text.init.refok is deprecated and __REF (.ref.text)
should be used in assembly files instead.  This patch cleans up a few
uses of .text.init.refok in the sparc architecture.

Also fix a reference to .text.init in a comment that wasn't updated to
.init.text.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-27 19:51:58 -07:00
Tim Abbott ce8a7424d2 sparc: convert to use __HEAD and HEAD_TEXT macros.
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text".  Since this commit changes all
users in the architecture, this change should be harmless.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-26 09:20:39 -07:00
Sam Ravnborg 86ed40bd6f sparc: unify sections.h
While doing this use standard names for start/end
so we could use definitions straight from asm-generic
for all the typical symbols.

This also allowed us to drop the use of PROVIDE in the linker
script so sprc is less non-standard on this area.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-27 00:35:12 -08:00
Sam Ravnborg d670bd4f80 sparc: prepare kernel/ for unification
o sparc32 files with identical names to sparc64 renamed to <name>_32.S
o introduced a few Kconfig helpers to simplify Makefile logic
o refactored Makefile to prepare for unification
  - use obj-$(CONFIG_SPARC32) for sparc32 specific files
  - use <name>_$(BITS) for files where sparc64 has a _64 variant
  - sparc64 directly include a few files where sparc32 builds them,
    refer to these files directly (no BITS)
  - sneaked in -Werror as used by sparc64
o modified sparc/Makefile to use the new names for head/init_task

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:20 -08:00