History log of /arch/powerpc/kernel/head_32.S
Revision Date Author Comments
a546498f3bf9aac311c66f965186373aee2ca0b0 07-Mar-2012 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Call do_page_fault() with interrupts off

We currently turn interrupts back to their previous state before
calling do_page_fault(). This can be annoying when debugging as
a bad fault will potentially have lost some processor state before
getting into the debugger.

We also end up calling some generic code with interrupts enabled
such as notify_page_fault() with interrupts enabled, which could
be unexpected.

This changes our code to behave more like other architectures,
and make the assembly entry code call into do_page_faults() with
interrupts disabled. They are conditionally re-enabled from
within do_page_fault() in the same spot x86 does it.

While there, add the might_sleep() test in the case of a successful
trylock of the mmap semaphore, again like x86.

Also fix a bug in the existing assembly where r12 (_MSR) could get
clobbered by C calls (the DTL accounting in the exception common
macro and DISABLE_INTS) in some cases.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2. Add the r12 clobber fix
6dece0eb69b2a28e18d104bc5d707f1cb673f5e0 25-Jul-2011 Scott Wood <scottwood@freescale.com> powerpc/32: Pass device tree address as u64 to machine_init

u64 is used rather than phys_addr_t to keep things simple, as
this is called from assembly code.

Update callers to pass a 64-bit address in r3/r4. Other unused
register assignments that were once parameters to machine_init
are dropped.

For FSL BookE, look up the physical address of the device tree from the
effective address passed in r3 by the loader. This is required for
situations where memory does not start at zero (due to AMP or IOMMU-less
virtualization), and thus the IMA doesn't start at zero, and thus the
device tree effective address does not equal the physical address.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
f38aa708776aefd9e3ba7ec1211c07efe9fa3227 16-May-2011 Sebastian Siewior <sebastian@breakpoint.cc> powerpc: Remove last piece of GEMINI

It seems that Adrian is getting old. He removed almost everything of
GEMINI in commit c53653130 ("[POWERPC] Remove the broken Gemini
support") except this piece.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
69e3cea8d5fd52677f2b6219542d0f8b53fe4c80 19-May-2011 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/smp: Make start_secondary_resume available to all CPU variants

This should fix SMP & Hotplug builds on FSL BookE and 476

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
fa3f82c8bb7acbe049ea71f258b3ae0a33d9d40b 10-Feb-2011 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/smp: soft-replugged CPUs must go back to start_secondary

Various thing are torn down when a CPU is hot-unplugged. That CPU
is expected to go back to start_secondary when re-plugged to re
initialize everything, such as clock sources, maps, ...

Some implementations just return from cpu_die() callback
in the idle loop when the CPU is "re-plugged". This is not enough.

We fix it using a little asm trampoline which resets the stack
and calls back into start_secondary as if we were all fresh from
boot. The trampoline already existed on ppc64, but we add it for
ppc32

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
dd84c21748d9280f210565429b1bdb9b6353e8d2 16-Apr-2010 Alexander Graf <agraf@suse.de> KVM: PPC: Add KVM intercept handlers

When an interrupt occurs we don't know yet if we're in guest context or
in host context. When in guest context, KVM needs to handle it.

So let's pull the same trick we did on Book3S_64: Just add a macro to
determine if we're in guest context or not and if so jump on to KVM code.

CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
d1d56f8c1d5a622228177eca47e9dcff0498bddb 12-Dec-2009 Albert Herranz <albert_herranz@yahoo.es> powerpc: gamecube/wii: early debugging using usbgecko

Add support for using the USB Gecko adapter as an early debugging
console on the Nintendo GameCube and Wii video game consoles.
The USB Gecko is a 3rd party memory card interface adapter that provides
a EXI (External Interface) to USB serial converter.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
ee43eb788b3a06425fffb912677e2e1c8b00dd3b 14-Jul-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Use names rather than numbers for SPRGs (v2)

The kernel uses SPRG registers for various purposes, typically in
low level assembly code as scratch registers or to hold per-cpu
global infos such as the PACA or the current thread_info pointer.

We want to be able to easily shuffle the usage of those registers
as some implementations have specific constraints realted to some
of them, for example, some have userspace readable aliases, etc..
and the current choice isn't always the best.

This patch should not change any code generation, and replaces the
usage of SPRN_SPRGn everywhere in the kernel with a named replacement
and adds documentation next to the definition of the names as to
what those are used for on each processor family.

The only parts that still use the original numbers are bits of KVM
or suspend/resume code that just blindly needs to save/restore all
the SPRGs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4a5cbf17c49a6024a6d7baf03efdffb8ed252bb1 18-Jun-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Map more memory early on 601 processors

The 32-bit kernel relies on some memory being mapped covering
the kernel text,data and bss at least, early during boot before
the full MMU setup is done. On 32-bit "classic" processors, this
is done using BAT registers.

On 601, the size of BATs is limited to 8M and we use 2 of them
for that initial mapping. This can become quite tight when enabling
features like lockdep, so let's use a 3rd one to bump that mapping
from 16M to 24M. We keep the 4th BAT free as it can be useful for
debugging early boot code to map things like serial ports.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
37f9ef553bed630957e025504cdcbc76f5de49d5 12-Jun-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Fix bug in move of altivec code to vector.S

The patch that moved to vector.S and made common between 32 and 64-bit the
altivec code had a nasty bug on 32-bit (did I really test that ?) which
causes the kernel to blr back into userspace ... oops :-)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
e821ea70f3b4873b50056a1e0f74befed1014c09 02-Jun-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Move VMX and VSX asm code to vector.S

Currently, load_up_altivec and give_up_altivec are duplicated
in 32-bit and 64-bit. This creates a common implementation that
is moved away from head_32.S, head_64.S and misc_64.S and into
vector.S, using the same macros we already use for our common
implementation of load_up_fpu.

I also moved the VSX code over to vector.S though in that case
I didn't make it build on 32-bit (yet).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
e70398458738fd26f96adc95eea8efe908809f08 26-Apr-2009 Tim Abbott <tabbott@MIT.EDU> powerpc: 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2319f1239592d0de80414ad2338c2bd7384a2a41 19-Mar-2009 Kumar Gala <galak@kernel.crashing.org> powerpc/mm: e300c2/c3/c4 TLB errata workaround

Complete workaround for DTLB errata in e300c2/c3/c4 processors.

Due to the bug, the hardware-implemented LRU algorythm always goes to way
1 of the TLB. This fix implements the proposed software workaround in
form of a LRW table for chosing the TLB-way.

Based on patch from David Jander <david@protonic.nl>

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
eb3436a0139a651a39dbb37a75b10a2cccd00ad5 19-Mar-2009 Kumar Gala <galak@kernel.crashing.org> powerpc/mm: Used free register to save a few cycles in SW TLB miss handling

Now that r0 is free we can keep the value of I/DMISS in r3 and not reload
it before doing the tlbli/d. This saves us a few cycles in the fast path
case.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
00fcb14703d8322a9c66cb3f48b5c49ac7d43f0a 19-Mar-2009 Kumar Gala <galak@kernel.crashing.org> powerpc/mm: Remove unused register usage in SW TLB miss handling

Long ago we had some code that actually used the CTR in the SW TLB
miss handlers (603/e300). Since we don't use it no reason to waste
cycles saving it off and restoring it (we actually didn't restore it
in the fast path case).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
345953cf9a44b19c98f8c0fe6ca7724202bcdb94 14-Mar-2009 Kumar Gala <galak@kernel.crashing.org> powerpc/mm: Fix Respect _PAGE_COHERENT on classic ppc32 SW TLB load machines

Grant picked up the wrong version of "Respect _PAGE_COHERENT on classic
ppc32 SW" (commit a4bd6a93c3f14691c8a29e53eb04dc734b27f0db)

It was missing the code to actually deal with the fixup of
_PAGE_COHERENT based on the CPU feature.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
a4bd6a93c3f14691c8a29e53eb04dc734b27f0db 17-Mar-2009 Kumar Gala <galak@kernel.crashing.org> powerpc/mm: Respect _PAGE_COHERENT on classic ppc32 SW

Since we now set _PAGE_COHERENT in the Linux PTE we shouldn't be clearing
it out before we setup the SW TLB. Today all the SW TLB machines
(603/e300) that we support are non-SMP, however there are some errata on
some devices that cause us to set _PAGE_COHERENT via CPU_FTR_NEED_COHERENT.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
28794d34ecb6815a3fa0a4256027c9b081a17c5f 10-Mar-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/kconfig: Kill PPC_MULTIPLATFORM

CONFIG_PPC_MULTIPLATFORM is a remain of the pre-powerpc days and isn't
really meaningful anymore. It was basically equivalent to PPC64 || 6xx.

This removes it along with the following changes:

- 32-bit platforms that relied on PPC32 && PPC_MULTIPLATFORM now rely
on 6xx which is what they want anyway.

- A new symbol, PPC_BOOK3S, is defined that represent compliance with
the "Server" variant of the architecture. This is set when either 6xx
or PPC64 is set and open the door for future BOOK3E 64-bit.

- 64-bit platforms that relied on PPC64 && PPC_MULTIPLATFORM now use
PPC64 && PPC_BOOK3S

- A separate and selectable CONFIG_PPC_OF_BOOT_TRAMPOLINE option is now
used to control the use of prom_init.c

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ccdcef72c249c289898b164eada89a61855b9287 17-Dec-2008 Dale Farnsworth <dale@farnsworth.org> powerpc/32: Add the ability for a classic ppc kernel to be loaded at 32M

Add the ability for a classic ppc kernel to be loaded at an address
of 32MB. This done by fixing a few places that assume we are loaded
at address 0, and by changing several uses of KERNELBASE to use
PAGE_OFFSET, instead.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
7c03d653cd257793dc40520c94e229b5fd0578e7 18-Dec-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/mm: Introduce MMU features

We're soon running out of CPU features and I need to add some new
ones for various MMU related bits, so this patch separates the MMU
features from the CPU features. I moved over the 32-bit MMU related
ones, added base features for MMU type families, but didn't move
over any 64-bit only feature yet.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5e696617c425eb97bd943d781f3941fb1e8f0e5b 18-Dec-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/mm: Split mmu_context handling

This splits the mmu_context handling between 32-bit hash based
processors, 64-bit hash based processors and everybody else. This is
preliminary work for adding SMP support for BookE processors.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2bda347bc53fe2cacd5621d8a0426840a8d2a6a6 13-Oct-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Fix 32-bit SMP boot on CHRP

prom_init was changed to take a new argument, the address
where the kernel is loaded, which is now used to copy the
SMP spin loop down before use.

However, only head_64.S was adapted to pass this new value,
not head_32.S, thus breaking SMP boot on 32-bit SMP CHRP
machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4ee7084eb11e00eb02dc8435fd18273a61ffa9bf 24-Sep-2008 Becky Bruce <becky.bruce@freescale.com> POWERPC: Allow 32-bit hashed pgtable code to support 36-bit physical

This rearranges a bit of code, and adds support for
36-bit physical addressing for configs that use a
hashed page table. The 36b physical support is not
enabled by default on any config - it must be
explicitly enabled via the config system.

This patch *only* expands the page table code to accomodate
large physical addresses on 32-bit systems and enables the
PHYS_64BIT config option for 86xx. It does *not*
allow you to boot a board with more than about 3.5GB of
RAM - for that, SWIOTLB support is also required (and
coming soon).

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
9acd57ca74b12bc8ba8da12c72b19ede2cddcb53 14-Aug-2008 Rocky Craig <rocky.craig@hp.com> powerpc: Fix TLB invalidation on boot on 32-bit

The intent of "flush_tlbs" is to invalidate all TLB entries by doing a
TLB invalidate instruction for all pages in the address range 0 to
0x00400000. A loop counter is set up at the high value and
decremented by page size. However, the loop is only done once as the
sense of the conditional branch at the loop end does not match the
setup/decrement. This fixes it to do the whole range by correcting
the branch condition.

Signed-off-by: Rocky Craig <rocky.craig@hp.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6f3d8e6947ec98e358514fc0f7b2e37fe88a21bb 25-Jun-2008 Michael Neuling <mikey@neuling.org> powerpc: Make load_up_fpu and load_up_altivec callable

Make load_up_fpu and load_up_altivec callable so they can be reused by
the VSX code.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ec2b36b9f23cfbbe94d89724b796b44fd57d5221 17-Apr-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Move stackframe definitions to common header

This moves various definitions used all over the place to parse stack
frames to ptrace.h so only one definition is needed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
445857e0fc16ba3f74e778dd5a8707459c84f933 31-Jan-2008 Dale Farnsworth <dale@farnsworth.org> [POWERPC] Remove dead code at KernelAltiVec

This code isn't referenced anywhere, so remove it.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
bee86f14d51a5a9a3b1897e301da1e415df0ba23 06-Dec-2007 Kumar Gala <galak@kernel.crashing.org> [POWERPC] Fix swapper_pg_dir size when CONFIG_PTE_64BIT=y on FSL_BOOKE

The size of swapper_pg_dir is 8k instead of 4k when using 64-bit PTEs
(CONFIG_PTE_64BIT).

This was reported by Cedric Hombourger <chombourger@gmail.com>

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
8a13c4f972e6c107d8cff54de647544c00e25b41 11-Oct-2007 Kumar Gala <galak@kernel.crashing.org> [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers

Move to using PAGE_OFFSET instead of TASK_SIZE or KERNELBASE value on
6xx/40x/44x/fsl-booke to determine if the faulting address is a kernel or
user space address. This mimics how the macro is_kernel_addr() works.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
c374e00e17f1c10768d5af922a1ff33e43df2eb0 16-Jul-2007 Scott Wood <scottwood@freescale.com> [POWERPC] Add early debug console for CPM serial ports.

This code assumes that the ports have been previously set up, with
buffers in DPRAM.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
19a8d97d89442e2bda6245b8a3de2c1fec69a7ad 17-Sep-2007 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] Remove cmd_line from head*.S

It is just a C char array, so declare it thusly.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
748a768384e05c021ea6be221b80c62a83d7b520 13-Sep-2007 Kumar Gala <galak@kernel.crashing.org> [POWERPC] Fix modpost warnings from head*.S on ppc32

We get warnings like the following from the various ppc32 head*.S files:

WARNING: vmlinux.o(.text+0x358): Section mismatch: reference to .init.text:early_init (between 'skpinv' and 'interrupt_base')
WARNING: vmlinux.o(.text+0x380): Section mismatch: reference to .init.text:machine_init (between 'skpinv' and 'interrupt_base')
WARNING: vmlinux.o(.text+0x384): Section mismatch: reference to .init.text:MMU_init (between 'skpinv' and 'interrupt_base')
WARNING: vmlinux.o(.text+0x3aa): Section mismatch: reference to .init.text:start_kernel (between 'skpinv' and 'interrupt_base')
WARNING: vmlinux.o(.text+0x3ae): Section mismatch: reference to .init.text:start_kernel (between 'skpinv' and 'interrupt_base')

Added a .text.head section simliar to what other architectures do since
modpost already excludes this from its warnings.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
bde6c6e16aa489ea76c762fb7ffb0abb48660dd8 06-Sep-2007 Scott Wood <scottwood@freescale.com> [POWERPC] Check _PAGE_RW and _PAGE_PRESENT on kernel addresses

Previously, the TLB miss handlers assumed that pages above KERNELBASE are
always present and read/write. This assumption is false in the case of
CONFIG_DEBUG_PAGEALLOC.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f21f49ea639ac3f24824177dac1268af75a2d373 13-Jun-2007 David Gibson <david@gibson.dropbear.id.au> [POWERPC] Remove the dregs of APUS support from arch/powerpc

APUS (the Amiga Power-Up System) is not supported under arch/powerpc
and it's unlikely it ever will be. Therefore, this patch removes the
fragments of APUS support code from arch/powerpc which have been
copied from arch/ppc.

A few APUS references are left in asm-powerpc in .h files which are
still used from arch/ppc.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
c53653130f2868e44c6e8346d110d27d39e7d07b 14-Jan-2007 Adrian Bunk <bunk@stusta.de> [POWERPC] Remove the broken Gemini support

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
aa42c69c67f82e88f0726258efe7306708e1cf14 08-Dec-2006 Kim Phillips <kim.phillips@freescale.com> [POWERPC] Add support for FP emulation for the e300c2 core

The e300c2 has no FPU. Its MSR[FP] is grounded to zero. If an attempt
is made to execute a floating point instruction (including floating-point
load, store, or move instructions), the e300c2 takes a floating-point
unavailable interrupt.

This patch adds support for FP emulation on the e300c2 by declaring a
new CPU_FTR_FP_TAKES_FPUNAVAIL, where FP unavail interrupts are
intercepted and redirected to the ProgramCheck exception path for
correct emulation handling.

(If we run out of CPU_FTR bits we could look to reclaim this bit by adding
support to test the cpu_user_features for PPC_FEATURE_HAS_FPU instead)

It adds a nop to the exception path for 32-bit processors with a FPU.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
ee0339f205d60375c5ce1653c0dc318c6ec72668 18-Jun-2006 Jon Loeliger <jdl@jdl.com> [POWERPC] Add starting of secondary 86xx CPUs.

Clear the high BATS during load_up_mmu if FTR_HAS_HIGH_BATS.
Allow just a bit more time for secondary CPUs to phone home.

Signed-off-by: Wei Zhang <Wei.Zhang@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f1434a4854407a262d194411245eb9ee66221f90 22-Feb-2006 Alan Curry <pacman@TheWorld.com> [PATCH] powerpc: fix altivec_unavailable_exception Oopses

altivec_unavailable_exception is called without setting r3... it looks like
the r3 that actually gets passed in as struct pt_regs *regs is the
undisturbed value of r3 at the time the altivec instruction was encountered.
The user actually gets to choose the pt_regs printed in the Oops!

This fixes the oops by passing the correct pt_regs pointer to
altivec_unavailable_exception.

Signed-off-by: Alan Curry <pacman@TheWorld.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
0a498d96a3324c16add35da0435bc7c13b6c6f3f 09-Jan-2006 Paul Mackerras <paulus@samba.org> powerpc: set CONFIG_PPC_OF=y always for ARCH=powerpc

The CONFIG_PPC_OF symbol is used to mean that the firmware device tree
access functions are available. Since we always have a device tree
with ARCH=powerpc, make CONFIG_PPC_OF always Y for ARCH=powerpc.

This fixes some compile errors reported by Kumar Gala, but in a
different way to his patch. This also makes prom_parse.o be compiled
only if CONFIG_PPC_OF so that non-OF ARCH=ppc platforms will compile.

Signed-off-by: Paul Mackerras <paulus@samba.org>
555d97ac87aef08bb55dff6f05e68fe2987d6f6d 16-Dec-2005 Andy Fleming <afleming@freescale.com> [PATCH] powerpc: G4+ oprofile support

This patch adds oprofile support for the 7450 and all its multitudinous
derivatives.

* Added 7450 (and derivatives) support for oprofile
* Changed e500 cputable to have oprofile model and cpu_type fields
* Added support for classic 32-bit performance monitor interrupt
* Cleaned up common powerpc oprofile code to be as common as possible
* Cleaned up oprofile_impl.h to reflect 32 bit classic code
* Added 32-bit MMCRx bitfield definitions and SPR numbers

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
d7f3945420b5d8114f2d4d85e90abe5063cc196a 23-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] powerpc: Add back support for booting from BootX (#2)

ARCH=powerpc couldn't boot from BootX as it uses a "different" way of
getting in the kernel. This patch adds the necessary trampolines,
creating a flattened device-tree from the tree passed from MacOS, and
initializing the btext engine early for really-early debugging.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
51d3082fe6e55aecfa17113dbe98077c749f724c 23-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] powerpc: Unify udbg (#2)

This patch unifies udbg for both ppc32 and ppc64 when building the
merged achitecture. xmon now has a single "back end". The powermac udbg
stuff gets enriched with some ADB capabilities and btext output. In
addition, the early_init callback is now called on ppc32 as well,
approx. in the same order as ppc64 regarding device-tree manipulations.
The init sequences of ppc32 and ppc64 are getting closer, I'll unify
them in a later patch.

For now, you can force udbg to the scc using "sccdbg" or to btext using
"btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg
output to something else than the autodetected OF output device in a
later patch.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
22c841c9a465a6b29a6140fcc5dae9fdb3c8674d 11-Nov-2005 Paul Mackerras <paulus@samba.org> powerpc: Initialize secondary CPU setup for 32-bit SMP

32-bit SMP powermacs weren't booting with ARCH=powerpc because the
boot cpu wasn't saving away the state of various control registers,
but the secondary CPUs were loading them from the uninitialized
state. This adds the necessary save-state call.

Signed-off-by: Paul Mackerras <paulus@samba.org>
f78541dcec327b0c46b150ee7d727f3db80275c4 28-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Merge xmon

The merged version follows the ppc64 version pretty closely mostly,
and in fact ARCH=ppc64 now uses the arch/powerpc/xmon version.
The main difference for ppc64 is that the 'p' command to call
show_state (which was always pretty dodgy) has been replaced by
the ppc32 'p' command, which calls a given procedure (so in fact
the old 'p' command behaviour can be achieved with 'p $show_state').

Signed-off-by: Paul Mackerras <paulus@samba.org>
d73e0c99f5c45e7b86d38725a4ff49f6746f5353 28-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Rename asm offset TRAP to _TRAP for 32-bit

... for consistency with 64-bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
bbd0abda9cc689a54df509aae00000bbb2a1a7d1 26-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Merge 32-bit CHRP support.

SMP still needs more work but UP gets as far as starting userspace
at least. This uses the 64-bit-style code for spinning up the cpus.

Signed-off-by: Paul Mackerras <paulus@samba.org>
77f543cb467c44960bafa6c91f5af75919d693e4 18-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Fix various compile errors with ARCH=ppc, ppc64 and powerpc

This makes ppc use the syscalls.c from arch/powerpc/kernel, exports
copy_and_flush from head_32.S for use by prom_init.c (ARCH=powerpc),
and consolidates the sys_fadvise64_64 implementations for 32-bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
30cd4a4e9c25e154ba087848a839bd0c6d024092 17-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Initialize btext subsystem later, after prom_init

We were initializing the btext stuff from prom_init(), thus breaking
the rule that all communication between prom_init() and the rest of
the kernel has to be via the flattened device tree. This removes
the btext initialization calls from prom_init() and initializes it
instead after the device tree is unflattened. It would be nice to
do it earlier, but that needs some more infrastructure to find the
properties we need in the flattened device tree.

Signed-off-by: Paul Mackerras <paulus@samba.org>
7dffb72028bfd909ac51a1546d182de2df4d2426 17-Oct-2005 Stephen Rothwell <sfr@canb.auug.org.au> ppc32: use L1_CACHE_SHIFT/L1_CACHE_BYTES

instead of L1_CACHE_LINE_SIZE and LG_L1_CACHE_LINE_SIZE

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
b3b8dc6c07cecc1f8d52d03f677206bdf9f794c9 10-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Use reg.h instead of processor.h when we just want reg names

Now that the register names and bit definitions are all in reg.h,
use that instead of processor.h in assembly code in a few places.

Signed-off-by: Paul Mackerras <paulus@samba.org>
70d64ceaa1a84d2502405422a4dfd3f87786a347 10-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Rename files to have consistent _32/_64 suffixes

This doesn't change any code, just renames things so we consistently
have foo_32.c and foo_64.c where we have separate 32- and 64-bit
versions.

Signed-off-by: Paul Mackerras <paulus@samba.org>