Commit graph android_kernel_sony_sdm845/include/asm-powerpc
Message SHA1
powerpc: Fix interrupt-tree parsing
The interrupt-tree parsing code wasn't offsetting interrupt numbers
by 16 on 32-bit platforms with an i8259 interrupt controller, and
it was confused about the encoding of interrupt sense and level
(which is different for i8259 and openpic interrupt controllers,
just to make things interesting).

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

Paul Mackerras   commited 2005-10-26 17:19:06 +10:00
6d0124fc06
powerpc: Pull out MPC106 (grackle) initialization code into its own file
This is so that the 32-bit CHRP code can use it.  The MPC106
initialization code is now in arch/powerpc/sysdev/grackle.c and
is controlled by CONFIG_PPC_MPC106.

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

Paul Mackerras   commited 2005-10-26 17:16:38 +10:00
830825d6c3
powerpc: Merge i8259.c into arch/powerpc/sysdev
This changes the parameters for i8259_init so that it takes two
parameters: a physical address for generating an interrupt
acknowledge cycle, and an interrupt number offset.  i8259_init
now sets the irq_desc[] for its interrupts; all the callers
were doing this, and that code is gone now.  This also defines
a CONFIG_PPC_I8259 symbol to select i8259.o for inclusion, and
makes the platforms that need it select that symbol.

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

Paul Mackerras   commited 2005-10-26 16:47:42 +10:00
f9bd170a87
[PATCH] powerpc: Move firmware.h into include/asm-powerpc
Move firmware.h into include/asm-powerpc.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Michael Ellerman   authored and   Paul Mackerras   commited 2005-10-26 16:00:26 +10:00
21f35f2822
[PATCH] powerpc: Remove trailing \n" in HMT macros
GCC 3.3.3 barfs on the trailing \n" in the HMT macros.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Michael Ellerman   authored and   Paul Mackerras   commited 2005-10-26 16:00:19 +10:00
8c71632f7a
[PATCH] powerpc: Remove duplicate definition of set_tb()
Somewhere along the line we got two definitions of set_tb(). They look to
be identical although they're not textually identical. So remove the #ifdef
CONFIG_PPC64 version, leaving the common version in time.h.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Michael Ellerman   authored and   Paul Mackerras   commited 2005-10-26 16:00:09 +10:00
a6f3546ecd
[PATCH] powerpc: Fix types.h
Powerpc: Fix types.h

I noticed that Paul had already pulled the version of types.h that
is missing the config.h include into the merge tree - this patch adds
it back in.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Becky Bruce   authored and   Paul Mackerras   commited 2005-10-26 15:54:42 +10:00
bfbac49736
[PATCH] powerpc: merge include/asm-ppc*/checksum.h into include/asm-powerpc/checksum.h
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Kumar Gala   authored and   Paul Mackerras   commited 2005-10-26 15:54:31 +10:00
d95bbcb3a3
[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>

Kumar Gala   authored and   Paul Mackerras   commited 2005-10-26 15:52:56 +10:00
60dda2565b
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>

Stephen Rothwell   commited 2005-10-24 17:40:23 +10:00
340601043d
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>

Stephen Rothwell   commited 2005-10-24 15:42:12 +10:00
6fdf5392ca
powerpc: Move include/asm-ppc64/vio.h to include/asm-powerpc/vio.h
Move include/asm-ppc64/vio.h to include/asm-powerpc/vio.h, that's it.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-24 15:41:58 +10:00
f38d87f566
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>

Paul Mackerras   commited 2005-10-23 17:14:56 +10:00
96c4450760
Merge changes from linux-2.6 by hand
Paul Mackerras   commited 2005-10-22 16:51:34 +10:00
985990137e
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>

Paul Mackerras   commited 2005-10-22 16:02:39 +10:00
35499c0195
powerpc: Make set_rtc_time() return error code from lower-level function
Previously it ignored the return value from ppc_md.set_rtc_time,
but in fact the functions that that can point to do return a
useful error code, so return it from set_rtc_time().

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

Paul Mackerras   commited 2005-10-22 15:57:55 +10:00
b6ba92819d
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>

Paul Mackerras   commited 2005-10-22 14:55:23 +10:00
a5b518ed31
[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>

David Gibson   authored and   Paul Mackerras   commited 2005-10-21 22:47:23 +10:00
6cb7bfebb1
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>

Paul Mackerras   commited 2005-10-20 22:33:06 +10:00
5d14a18d59
powerpc/ppc/ppc64: Various compile fixes.
This declares powersave_nap in system.h and makes it an int everywhere,
fixes typos for the maple platform, fixes a couple of places where
I missed removing the last two arguments from a message_pass function,
and makes ppc64 consistent with ppc32 in the type of the
pci_bridge.cfg_data field.

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

Paul Mackerras   commited 2005-10-20 21:10:09 +10:00
17a6392d30
powerpc: Merge various powermac-related header files.
Except for smu.h, which moved from asm-ppc64 to asm-powerpc, all
of these moved from asm-ppc to asm-powerpc.  In each case the
asm-ppc64 version (if there was one) was just a single line
including the asm-ppc version.

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

Paul Mackerras   commited 2005-10-20 20:53:39 +10:00
ff065ddd96
powerpc: Move smp_mpic_message_pass into mpic.c
Having it here rather than in arch/ppc64/kernel/smp.c means that
we can use it on 32-bit SMP systems easily with ARCH=powerpc.

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

Paul Mackerras   commited 2005-10-20 17:09:51 +10:00
a9c5926469
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>

Paul Mackerras   commited 2005-10-20 17:02:01 +10:00
d8699e65c6
[PATCH] powerpc: Merge types.h
This patch merges types.h into include/asm-powerpc. The only real change is
the removal of the include of linux/config.h from the 32-bit version - it
doesn't appear to be necessary.

This patch has been built on several different 32 and 64-bit platforms,
and booted on mpc8540_ads.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Becky Bruce   authored and   Paul Mackerras   commited 2005-10-20 16:22:50 +10:00
971dc77b64
[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>

David Gibson   authored and   Paul Mackerras   commited 2005-10-20 16:22:24 +10:00
f7f6f4fea6
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>

Paul Mackerras   commited 2005-10-20 09:23:26 +10:00
f2783c1500
powerpc: Merge machdep.h
A few things change for consistency between ppc32 and ppc64:
idle functions return void; *_get_boot_time functions return
unsigned long (i.e. time_t) rather than filling in a struct rtc_time
(since that's useful to the callers and easier for pmac to
generate); *_get_rtc_time and *_set_rtc_time functions take
a struct rtc_time; irq_canonicalize is gone; nvram_sync returns
void.

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

Paul Mackerras   commited 2005-10-19 23:11:21 +10:00
143a1dec7e
powerpc: fix 32bit LOADADDR macro
I forgot a semicolon.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-17 11:46:53 +10:00
cf76485562
powerpc: move iSeries/iSeries_pci.h to platforms/iseries
The only real user of this file outside platforms/iseries was
drivers/net/iseries_veth.c but all it wanted was ISERIES_HV_ADDR()
so we move that to abs_addr.h (and lowercase it).

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-14 14:51:42 +10:00
426c1a11a6
powerpc: create 32 bit LOADADDR macro
and use it in misc_32.S

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-13 09:49:51 +10:00
7062018687
powerpc: consolidate cputable.c
Also simplify arch/ppc64/kernel/Makefile

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-13 09:49:45 +10:00
4920960f57
[PATCH] ppc32: Fix timekeeping
Interestingly enough, ppc32 had broken timekeeping for ages...  It
worked, but probably drifted a bit more than could be explained by the
actual bad precision of the timebase calibration.  We discovered that
recently when somebody figured out that the common code was using
CLOCK_TICK_RATE to correct the timekeeing, and ppc32 had a completely
bogus value for it.

This patch turns it into something saner.  Probably not as good as doing
something based on the actual timebase frequency precision but I'll
leave that sort of math to others.  This at least makes it better for
the common HZ values.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Benjamin Herrenschmidt   authored and   Linus Torvalds   commited 2005-10-12 08:24:47 -07:00
cbd27b8ced
powerpc: Bring in some changes made to arch/ppc and include/asm-ppc64
Recent commits upstream have changed files which are currently
duplicated in arch/powerpc and include/asm-powerpc.  This updates
them with the corresponding changes.

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

Paul Mackerras   commited 2005-10-12 17:01:50 +10:00
5629d41d5c
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>

Paul Mackerras   commited 2005-10-11 22:08:12 +10:00
fd582ec88e
powerpc: Merged asm/xmon.h
Xmon itself isn't merged yet, though.

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

Paul Mackerras   commited 2005-10-11 10:00:00 +10:00
60a3d74178
powerpc: Merged asm/i8259.h
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-11 09:59:44 +10:00
3b341c1c41
powerpc: Merged asm/backlight.h
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-11 09:59:38 +10:00
508c40227c
powerpc: Merge asm/unistd.h
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-10 22:56:11 +10:00
eef289f79c
powerpc: Merge asm/irq.h
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-10 22:54:57 +10:00
1b92313d5b
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>

Paul Mackerras   commited 2005-10-10 22:50:37 +10:00
40ef8cbc6d
powerpc: make process.c suitable for both 32-bit and 64-bit
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-10 22:29:05 +10:00
06d67d5474
powerpc: Merged processor.h.
This adds register definitions from the ppc64 processor.h to reg.h,
and makes a single merged processor.h.  I moved __is_processor from
the ppc64 system.h to the merged reg.h along with the PVR register
constants.

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

Paul Mackerras   commited 2005-10-10 14:19:43 +10:00
9f04b9e327
powerpc: Merge of_device.c and of_device.h
Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras   commited 2005-10-06 13:22:17 +10:00
2e686bc3bf
powerpc: Merge in the ppc64 version of the prom code.
This brings in the ppc64 version of prom_init.c, prom.c and btext.c
and makes them work for ppc32.  This also brings in the new calling
convention, where the first entry to the kernel (with r5 != 0) goes
to the prom_init code, which then restarts from the beginning (with
r5 == 0) after it has done its stuff.

For now this also brings in the ppc32 version of setup.c.  It also
merges lmb.h.

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

Paul Mackerras   commited 2005-10-06 12:06:20 +10:00
9b6b563c0d
powerpc: Define 32/64 bit asm macros and use them in fpu.S
These macros help in writing assembly code that works for both ppc32
and ppc64.  With this we now have a common fpu.S.  This takes out
load_up_fpu from head_64.S.

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

Paul Mackerras   commited 2005-10-06 10:59:19 +10:00
b85a046af3
powerpc: make iSeries build
Merge vmlinux.lds.S.
Also remove arch/powerpc/kernel/vmlinux.lds which is a
generated file.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Stephen Rothwell   commited 2005-10-01 18:52:10 +10:00
cabb558714
Merge Stephen Rothwell's patches
Paul Mackerras   commited 2005-09-28 21:11:41 +10:00
952ecef7a0
[PATCH] ppc32: make cur_cpu_spec a single pointer instead of an array
Changed ppc32 so that cur_cpu_spec is just a single pointer for all CPUs.
Additionally, made call_setup_cpu check to see if the cpu_setup pointer
is NULL or not before calling the function.  This lets remove the dummy
cpu_setup calls that just return.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Kumar Gala   authored and   Paul Mackerras   commited 2005-09-28 15:42:54 +10:00
400d221274
[PATCH] powerpc: merged asm/cputable.h
Merged cputable.h between ppc32 and ppc64.  In doing this removed support
for the BEGIN_FTR_SECTION/END_FTR_SECTION macros in C code since they
dont compile correctly.  C code should use cpu_has_feature().  This is
based on Arnd Bergmann's initial patch.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Kumar Gala   authored and   Paul Mackerras   commited 2005-09-28 15:42:53 +10:00
10b35d9978
[PATCH] powerpc: merge byteorder.h
powerpc: Merge byteorder.h

Essentially adopts the 64-bit version of this file.  The 32-bit version had
been using unsigned ints for arguments/return values that were actually
only 16 bits - the new file uses __u16 for these items as in the 64-bit
version of the header.  The order of some of the asm constraints
in the 64-bit version was slightly different than the 32-bit version,
but they produce identical code.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Becky Bruce   authored and   Paul Mackerras   commited 2005-09-28 15:42:53 +10:00
a559c91d77