Commit Graph

77 Commits (ab590ccb428f874bb8f9cec1265cc1f9cb38b601)

Author SHA1 Message Date
Kumar Gala 60dda2565b [PATCH] powerpc: some prom.c cleanups
On !CONFIG_PPC_MULTIPLATFORM _machine is defined as 0.  This is ok, but
we can't assign a value to _machine then.

We may not have CONFIG_PCI available, so only build in support for
find_parent_pci_resource(), request_OF_resource(), release_OF_resource()
if PCI is enabled.  This is probably not the long term fix but works out
for now.

Make reg_property64 contain 64-bit elements on a 32-bit machine.

Mark the deprecated prom.c functions as __deprecated.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-26 15:52:56 +10:00
Kumar Gala d2e6151257 [PATCH] powerpc: Make sure we have an RTC before trying to adjust it
Its valid for ppc_md.set_rtc_time to be NULL.  We need to check
that its non-NULL before trying to update the RTC.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-26 15:52:37 +10:00
Stephen Rothwell 340601043d powerpc: Add a shutdown member to vio_driver
Add a shutdown member to struct vio_driver. We also need vio_bus_shutdown()
which converts from struct device to struct vio_dev and knows how to extract
the struct vio_driver.

Original patch adjusted for different location of vio.c.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-24 17:40:23 +10:00
Stephen Rothwell 6fdf5392ca powerpc: don't duplicate name between vio_driver and device_driver
Just set the name field directly in the device_driver structure
contained in the vio_driver struct.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-24 15:42:12 +10:00
Stephen Rothwell 580460194e powerpc: Merge arch/ppc64/kernel/vio.c into arch/powerpc/kernel/vio.c
Merge arch/ppc64/kernel/vio.c into arch/powerpc/kernel/vio.c, update
the Makefiles to make it work, and make ARCH=ppc64 still work.

Michael's version put vio.c in arch/powerpc/sysedv but after consolting
Paulus, this one puts it in arch/powerpc/kernel.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-24 15:41:44 +10:00
Paul Mackerras a575b80717 powerpc: Run on old powermacs.
Old powermacs have a number of differences from current machines:
- there is no interrupt tree in the device tree, just interrupt
  or AAPL,interrupt properties
- the chosen node in the device tree is called /chosen@0
- the OF claim method doesn't map the memory, so we have to do
  an explicit map call as well
- there is no /chosen/cpu property on SMP machines
- the NVRAM isn't structured as a set of partitions.

This adapts the merged powermac support code to cope with these
issues.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-23 17:23:21 +10:00
Paul Mackerras 96c4450760 powerpc: Fix time code for 601 processors
The 601 doesn't have the timebase register; instead it has an RTCL
register that counts nanoseconds and wraps at 1000000000, and an
RTCU register that counts seconds.  This makes the necessary changes
for the merged time code to use the RTCL/U registers when the kernel
is running on a 601.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-23 17:14:56 +10:00
Paul Mackerras 985990137e Merge changes from linux-2.6 by hand 2005-10-22 16:51:34 +10:00
Paul Mackerras 35499c0195 powerpc: Merge in 64-bit powermac support.
This brings in a lot of changes from arch/ppc64/kernel/pmac_*.c to
arch/powerpc/platforms/powermac/*.c and makes various minor tweaks
elsewhere.  On the powermac we now initialize ppc_md by copying
the whole pmac_md structure into it, which required some changes in
the ordering of initializations of individual fields of it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-22 16:02:39 +10:00
Paul Mackerras a5b518ed31 ppc64/powerpc: Fix time initialization on SMP systems
This moves smp_space_timers from arch/ppc64/kernel/smp.c to
arch/powerpc/kernel/time.c and makes it initialize last_jiffy[]
instead of paca[].next_jiffy_update_tb, since last_jiffy[] is
now what the time code uses.  It also declares smp_space_timers
in include/asm-powerpc/time.h and gets rid of an ifdef in
div128_by_32.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-22 14:55:23 +10:00
Paul Mackerras e2b5530698 ppc64: Fix delivery of RT signals to 32-bit processes.
An error in merging led to 32-bit processes getting the wrong link
register value on entry to RT signal handlers, and the wrong stack
chain as well.  This fixes it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-22 14:46:33 +10:00
Paul Mackerras 5c8c56ebdf powerpc: Move agp_special_page export to where it is defined
... instead of exporting it in arch/*/kernel/ppc_ksyms.c.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-22 14:42:51 +10:00
Michael Ellerman 05d84681ab [PATCH] powerpc: Fix mmap returning 64 bit addresses
The merge of syscalls.c & sys_ppc32.c (30286ef6e0)
broke mmap, if the mmap returned a 64 bit address.

do_mmap2 was taking the return value from do_mmap_pgoff (an unsigned long), and
storing it in an int, before returning it to sys_mmap as an unsigned long. So
we were losing the high bits of the address.

You would have thought the compiler could catch this for us ...

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-21 22:47:52 +10:00
Michael Ellerman 90eac727c6 [PATCH] powerpc: Don't blow away load_addr in start_thread
The patch to make process.c work for 32-bit and 64-bit
(06d67d5474) broke some 64-bit binaries.
We were blowing away load_addr in gpr[2], so we weren't properly relocating
the entry point.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-21 22:47:39 +10:00
David Gibson 6cb7bfebb1 [PATCH] powerpc: Merge thread_info.h
Merge ppc32 and ppc64 versions of thread_info.h.  They were pretty
similar already, the chief changes are:

	- Instead of inline asm to implement current_thread_info(),
which needs to be different for ppc32 and ppc64, we use C with an
asm("r1") register variable.  gcc turns it into the same asm as we
used to have for both platforms.
	- We replace ppc32's 'local_flags' with the ppc64
'syscall_noerror' field.  The noerror flag was in fact the only thing
in the local_flags field anyway, so the ppc64 approach is simpler, and
means we only need a load-immediate/store instead of load/mask/store
when clearing the flag.
	- In readiness for 64k pages, when THREAD_SIZE will be less
than a page, ppc64 used kmalloc() rather than get_free_pages() to
allocate the kernel stack.  With this patch we do the same for ppc32,
since there's no strong reason not to.
	- For ppc64, we no longer export THREAD_SHIFT and THREAD_SIZE
via asm-offsets, thread_info.h can now be safely included in asm, as
on ppc32.

Built and booted on G4 Powerbook (ARCH=ppc and ARCH=powerpc) and
Power5 (ARCH=ppc64 and ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-21 22:47:23 +10:00
Paul Mackerras 5d14a18d59 powerpc: Fix some bugs in the new merged time code
I had the sense of the test for when to use the old 601-style RTC
registers inverted.  pmac_calibrate_decr and via_calibrate_decr
weren't setting ppc_tb_freq, on which all the further calculations
depended.  Lastly, update_gtod was losing the top 32 bits of
the new tb_to_xs value.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 22:33:06 +10:00
Paul Mackerras 374e99d450 powerpc: Move some calculations from xxx_calibrate_decr to time_init
Previously the individual xxx_calibrate_decr functions would each
print the timebase and cpu frequency and calculate several values
such as tb_to_us and tb_to_xs.  This moves those printks and
calculations into time_init just after the call to the platform's
calibrate_decr function.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 21:04:51 +10:00
Paul Mackerras 0458060c1c ppc64: Move init_boot_text call and conswitchp init into setup_arch
This way they get done in one place for all platforms, and it is
more consistent with what ppc32 does.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 21:00:20 +10:00
Paul Mackerras 0dd194d02d powerpc: Fix places where ppc_md.show_[per]cpuinfo was treated as int
I missed a few places where ppc code was still assuming that the
ppc_md.show_[per]cpuinfo functions returned int.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 20:48:19 +10:00
Paul Mackerras d8699e65c6 ppc64: Change ppc_md.get_cpuinfo to ppc_md.show_cpuinfo
... for consistency with ppc32; also add in ppc32's show_percpuinfo
function.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 17:02:01 +10:00
David Gibson f7f6f4fea6 [PATCH] powerpc: Merge ppc64 pmc.[ch] with ppc32 perfmon.[ch]
This patches the ppc32 and ppc64 versions of the headers and .c files
with helper functions for manipulating the performance counting
hardware.  As a side effect, it removes use of the term "perfmon" from
ppc32, thus avoiding confusion with the unrelated performance counter
interface from HP Labs also called "perfmon".

Built, but not booted, for g5, pSeries, iSeries, and 32-bit Powermac
with both ARCH=powerpc and ARCH=ppc{,64} as appropriate.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 16:22:24 +10:00
Paul Mackerras a4bcc95a3a powerpc: Fix a branch-too-far link error for 32-bit targets
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 09:24:18 +10:00
Paul Mackerras f2783c1500 powerpc: Merge time.c and asm/time.h.
We now use the merged time.c for both 32-bit and 64-bit compilation
with ARCH=powerpc, and for ARCH=ppc64, but not for ARCH=ppc32.
This removes setup_default_decr (folds its function into time_init)
and moves wakeup_decrementer into time.c.  This also makes an
asm-powerpc/rtc.h.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 09:23:26 +10:00
Paul Mackerras b123923d48 powerpc: Move ptrace32.c from arch/ppc64 to arch/powerpc
Also corrected my email address in ptrace.c and updated the comments
at the top of ptrace32.c.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-20 09:11:29 +10:00
Paul Mackerras 9b7cf8b49d powerpc: Eliminate a compile warning in signal_32.c
The second argument of get_sigset_t needed to have the const keyword.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-19 23:13:04 +10:00
Paul Mackerras 46aab8c584 Merge rsync://oak/kernels/iseries/work/ 2005-10-18 14:53:41 +10:00
Stephen Rothwell b09a4913b1 powerpc: change sys32_ to compat_sys_
This allows us to get rid of one type of entry in systbl.S.

In passing we remove the duplicate compat_sys_getdents and
compat_sys_utimes for which there are generic versions.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-18 14:51:57 +10:00
Paul Mackerras 77f543cb46 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>
2005-10-18 14:19:41 +10:00
Stephen Rothwell 81e7009ea4 powerpc: merge ppc signal.c and ppc64 signal32.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-18 11:17:58 +10:00
David Gibson 55d363397f [PATCH] powerpc: Another maple merge tree fix
With ARCH=powerpc, a spurious ifdef in prom_init prevented the
seconday hold loop being correctly copied down on Maple.  With this
patch, Maple boots with ARCH=powerpc

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17 21:43:12 +10:00
David Gibson 61f684ec07 [PATCH] powerpc: Fix use of LOADBASE in merge tree
The merge-tree version of LOADBASE actually loads the whole given
address from the toc for ppc64.  The matching OFF macro adjust for
this, using an offset of 0 for ppc64, but we weren't using that in
power4_idle.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17 21:43:12 +10:00
Kumar Gala ea703ce206 [PATCH] powerpc: replace use of _GLOBAL with .globl
The _GLOBAL() macro is for text symbols only. Changed to using
.globl for .data symbols.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17 21:43:12 +10:00
Paul Mackerras dd184343b4 powerpc: Clear the BSS at the start of early_init with ARCH=ppc
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17 20:13:47 +10:00
Paul Mackerras 30286ef6e0 powerpc: Merge syscalls.c and sys_ppc32.c.
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17 20:10:13 +10:00
Paul Mackerras 30cd4a4e9c 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>
2005-10-17 19:20:46 +10:00
Stephen Rothwell 7dffb72028 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>
2005-10-17 11:50:32 +10:00
Stephen Rothwell e8a30302ab powerpc: merge ptrace.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 15:52:04 +10:00
Stephen Rothwell eec5ef9098 ppc64: use powerpc of_device.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 15:16:25 +10:00
Stephen Rothwell d4bf9a7858 ppc64: merge binfmt_elf32.c
and use start_thread for both 32 and 64 bit bineries.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 13:40:54 +10:00
Stephen Rothwell 0f17d0742f powerpc: make 64 bit binaries work
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 09:49:56 +10:00
Stephen Rothwell 7062018687 powerpc: create 32 bit LOADADDR macro
and use it in misc_32.S

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 09:49:51 +10:00
Stephen Rothwell 4920960f57 powerpc: consolidate cputable.c
Also simplify arch/ppc64/kernel/Makefile

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-10-13 09:49:45 +10:00
Paul Mackerras 3eac8c69d1 powerpc: Move default hash table size calculation to hash_utils_64.c
We weren't computing the size of the hash table correctly on iSeries
because the relevant code in prom.c was #ifdef CONFIG_PPC_PSERIES.
This moves the code to hash_utils_64.c, makes it unconditional, and
cleans it up a bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-12 16:58:53 +10:00
Paul Mackerras 3abec857a0 ppc64: Use merged versions of init_task.c and process.c.
These two files are now built in arch/powerpc/kernel instead of
arch/ppc64/kernel.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-11 22:09:48 +10:00
Paul Mackerras fd582ec88e ppc: Various minor compile fixes
This fixes up a variety of minor problems in compiling with ARCH=ppc
arising from using the merged versions of various header files.
A lot of the changes are just adding #include <asm/machdep.h> to
files that use ppc_md or smp_ops_t.

This also arranges for us to use semaphore.c, vecemu.c, vector.S and
fpu.S from arch/powerpc/kernel when compiling with ARCH=ppc.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-11 22:08:12 +10:00
Paul Mackerras cc5aa206d2 powerpc: Remove debug messages from setup_64.c
A bunch of printks were left in arch/powerpc/kernel/setup_64.c from
when I was chasing a bug.  This removes them.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-11 17:35:20 +10:00
Paul Mackerras e574d238ab powerpc: Fix compilation for 32-bit configs
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-10 22:58:10 +10:00
Paul Mackerras c5200c90db powerpc: Fix off-by-one error in prom_init.c
This was preventing us from recognizing that we did actually
instantiate RTAS successfully on pSeries.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-10 22:57:03 +10:00
Paul Mackerras 40ef8cbc6d powerpc: Get 64-bit configs to compile with ARCH=powerpc
This is a bunch of mostly small fixes that are needed to get
ARCH=powerpc to compile for 64-bit.  This adds setup_64.c from
arch/ppc64/kernel/setup.c and locks.c from arch/ppc64/lib/locks.c.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-10 22:50:37 +10:00
Paul Mackerras bc6f8a4b19 powerpc: move lparmap.c to arch/powerpc/kernel
Since lparmap.s gets included in arch/powerpc/kernel/head_64.S,
this avoids depending on a file in another directory.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-10 22:45:07 +10:00