Commit graph

415 commits

Author SHA1 Message Date
David S. Miller 5fce09c6f6 sparc: Move irq_trans_init() and support code into seperate file.
All sparc64 specific, so only build this file on sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-05 17:02:32 -08:00
David S. Miller efeac2f876 sparc: Mark prom_early_alloc non-static.
A subsequent changeset will use this.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-05 17:01:27 -08:00
David S. Miller dfa76060be sparc: Create common area for OF device layer code.
This is where common code implementations will go as we unify
32-bit and 64-bit OF device tree code.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-05 17:00:13 -08:00
David S. Miller 657f201df6 sparc: Create common header file for prom_{32,64}.c
This is where common declarations will go as we unify
these files as much as possible into common code.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-05 16:44:29 -08:00
Sam Ravnborg b28017f57f sparc: unify kernel/init_task
A closer inspection revealed that these two files had identical
functionality - but the implementation of it differed slightly.

Base it on the sparc version as it was the best.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 13:28:09 -08:00
Sam Ravnborg 757498c63e sparc: drop CONFIG_SUN_AUXIO
It is always equals y so no need to test for it

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 13:26:31 -08:00
Nicolas Palix c2e27c359a sparc: Add missing of_node_put
of_node_put is needed before discarding a value received from
of_find_node_by_name, eg in error handling code or when the device
node is no longer used.

The semantic match that catches the bug is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression struct device_node *n;
position p1, p2;
struct device_node *n1;
statement S;
identifier f;
expression E;
expression *ptr != NULL;
@@

n@p1 = of_find_node_by_name(...)
...
if (!n) S
... when != of_node_put(n)
    when != n1 = f(n,...)
    when != E = n
    when any
    when strict
(
  return \(0\|<+...n...+>\|ptr\);
|
return@p2 ...;
|
  of_node_put(n);
|
  n1 = f(n,...)
|
  E = n
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s of_find_node_by_name %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:22 -08:00
Sam Ravnborg a88b5ba8bd sparc,sparc64: unify kernel/
o Move all files from sparc64/kernel/ to sparc/kernel
  - rename as appropriate
o Update sparc/Makefile to the changes
o Update sparc/kernel/Makefile to include the sparc64 files

NOTE: This commit changes link order on sparc64!

Link order had to change for either of sparc32 and sparc64.
And assuming sparc64 see more testing than sparc32 change link
order on sparc64 where issues will be caught faster.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:21 -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
Sam Ravnborg 14ae84c993 sparc: gitignore a few files
With this 'git status' no longer reports any new files
At least not for a sparc allnoconfig build

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:15 -08:00
Sam Ravnborg b5db854a91 sparc,sparc64: unify asm-offsets.c
sparc64 does not use constants generated from asm-offsets
but to prepare it to do so the parts that could be
shared do now generate constants for sparc64 too.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:12 -08:00
Sam Ravnborg 1b1fbbcaad sparc,sparc64: prepare vmlinux.lds.S for unification
This patch makes the two vmlinux.lds.S files identical
and serve as documentation for the changes in each file.

This mainly add stuffs to sparc32 that is otherwise only
used by sparc64 and thus it should have no effect.

Build tested only.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:11 -08:00
Al Viro 3a29db3222 sparc32: pdev_to_pnode() is used from __devinit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:08 -08:00
Al Viro 5bac287ea5 fix the section noise in sparc head.S
usual .text.head trick

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-30 10:03:37 -08:00
Al Viro 409832f548 sparc32 cpuinit flase positives
All noise since we don't have CPU hotplug there.  However, they
did expose something very odd-looking in there - poke_viking()
does a bunch of identical btfixup each time it's called (i.e.
for each CPU).  That one is left alone for now; just the trivial
misannotation fixes.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-30 10:03:35 -08:00
David Miller f8b2256e9c sparc64: wire up accept4()
This adds the sparc syscall hookups.

Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-19 18:49:57 -08:00
Kay Sievers 5acdc1fa2d sparc: struct device - replace bus_id with dev_name(), dev_set_name()
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-12 23:48:40 -08:00
David S. Miller 29b1432816 Revert "sparc: correct section of current_pc()"
This reverts commit 8dd9453737.

This fixes a boot failure reported by Robert Reif.

The code above the section change expects to fallthrough, so
we can't make such a section change here.
2008-11-10 12:33:30 -08:00
Krzysztof Helt 12a9ee3cce rtc-m48t59: shift zero year to 1968 on sparc (rev 2)
Shift the first year to 1968 for Sun SPARC machines.

Move this logic from platform specific files to rtc driver
as this fixes problems with calculating a century bit.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Tested-by: Alexander Beregalov
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-29 15:35:24 -07:00
Frederic Weisbecker 8dd9453737 sparc: correct section of current_pc()
Latest mainline gives this section mismatch on sparc:

The function current_pc() references
the variable __init no_sun4u_here.
This is often because current_pc lacks a __init
annotation or the annotation of no_sun4u_here is wrong.

Since current_pc() is used only in early time, it is correct to
put it in .init section.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-22 21:53:47 -07:00
Frederic Weisbecker a1731e5b9a sparc: correct section of apc_no_idle
The latest mainline gives this section mismatch on sparc:

The function __devinit apc_probe() references
a variable __initdata apc_no_idle.
If apc_no_idle is only used by apc_probe then
annotate apc_no_idle with a matching annotation.

Since the commit 7e7e2f0356,
apc_probe() is on __devinit so we have to correct apc_no_idle
which is referenced by this function.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-22 21:53:43 -07:00
Robert Reif 4245e59d12 sparc32: fix build errors
arch/sparc/kernel/sun4d_smp.c: In function ‘smp4d_callin’:
arch/sparc/kernel/sun4d_smp.c:101: error: implicit declaration of function ‘notify_cpu_starting’
arch/sparc/kernel/sun4m_smp.c: In function ‘smp4m_callin’:
arch/sparc/kernel/sun4m_smp.c:74: error: implicit declaration of function ‘notify_cpu_starting’

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-12 23:55:45 -07:00
David S. Miller 56c5d900db Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:

	sound/core/memalloc.c
2008-10-11 12:39:35 -07:00
Ingo Molnar 990d0f2ced Merge branches 'sched/devel', 'sched/cpu-hotplug', 'sched/cpusets' and 'sched/urgent' into sched/core 2008-10-08 11:31:02 +02:00
Robert Reif 6cf4a9243a sparc32: sun4m interrupt mask cleanup
Here is an updated version of a patch I wrote 6 years ago
http://marc.info/?l=linux-sparc&m=103939103607617&w=2
that simplifies interrupt mask lookup.  It's main purpose
is to add VME bus support but it's really a cleanup of the mask code.

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-07 15:24:02 -07:00
David Brownell a1cd0464c6 sparc: arch/sparc/kernel/pmc.c -- extra #include?
I have no SPARC compiler handy to verify, but it looks like this
is another file that doesn't need <linux/miscdevices.h> ...

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-21 00:28:26 -07:00
David S. Miller 778b1c65bf sparc32: Add more extensive documentation of sun4m interrupts.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:05 -07:00
David S. Miller e7913de928 sparc32: Kill irq_rcvreg from sun4m_irq.c
Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:04 -07:00
David S. Miller c7e606a8f8 sparc32: Delete master_l10_limit.
It is only set, never used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:03 -07:00
David S. Miller 8bd8deead7 sparc32: Use PROM device probing for sun4c timers.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:02 -07:00
David S. Miller 45bb5a7cbf sparc32: Use PROM device probing for sun4c interrupt register.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:01 -07:00
David S. Miller 5ff0d55f93 sparc32: Delete claim_ticker14().
No more users.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:18:01 -07:00
David S. Miller b218fa0e9c sparc32: Stop calling claim_ticker14() from sun4c_irq.c
Since the first argument is always NULL, the only side effect
is to disable the PROFILE_IRQ, so just do that directly.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:59 -07:00
David S. Miller 76954261ba sparc32: Kill clear_profile_irq btfixup entry.
Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:59 -07:00
David S. Miller 1de937a536 sparc32: Call sun4m_clear_profile_irq() directly from sun4m_smp.c
This is the only use of the clear_profile_irq() btfixup entry,
which just eats up lots of dead space on other platform types.

A subsequent commit will delete the other implementations and
the btfixup entry as well.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:58 -07:00
David S. Miller a73554aedb sparc32: Remove #if 0'd code from sun4c_irq.c
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:57 -07:00
David S. Miller f8376e933c sparc32: Remove some SMP ifdefs in sun4d_irq.c
Always do the sbus_tid[] handling.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:56 -07:00
David S. Miller f5f1085720 sparc32: Use PROM infrastructure for probing and mapping sun4d timers.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:56 -07:00
David S. Miller 69c010b245 sparc32: Use PROM device probing for sun4m irq registers.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-19 21:17:43 -07:00
David S. Miller 2e57572a50 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts:

	arch/sparc64/kernel/pci_psycho.c
2008-09-16 14:11:43 -07:00
David S. Miller 9b2e43ae4e sparc32: Use PROM device probing for sun4m timer registers.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-13 21:37:32 -07:00
David S. Miller 7d4ee289d1 sparc: Fix user_regset 'n' field values.
As noticed by Russell King, we were not setting this properly
to the number of entries, but rather the total size.

This results in the core dumping code allocating waayyyy too
much memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-12 15:55:44 -07:00
David S. Miller 3c50370103 sparc: Fix user_regset 'n' field values.
As noticed by Russell King, we were not setting this properly
to the number of entries, but rather the total size.

This results in the core dumping code allocating waayyyy too
much memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-12 15:01:31 -07:00
David S. Miller 3fbe36d8da sparc32: Call parse_early_param() in setup_arch().
Mirror sparc64.  This will allow us to use early_param() on
sparc32 too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-10 23:40:32 -07:00
David S. Miller bdba4d6b77 sparc32: Fix function signature of of_bus_sbus_get_flags().
This doesn't match the function pointer type it gets assigned
to.  Luckily, this was harmless.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-10 23:38:51 -07:00
David S. Miller ab138c031f sparc32: Need to close openned RTC device just like sparc64.
Otherwise we get refcount problems.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-10 13:36:13 -07:00
David S. Miller 7b1af32f52 sparc32: Move sun4d show_leds() out of asm/obio.h
Put it, as well as cpu_leds[] array, into sun4d_irq.c

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-08 15:40:45 -07:00
David S. Miller 365b50f0f0 sparc32: Fix coding style of sparc_cpu_model setting code.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-08 15:40:31 -07:00
David S. Miller 98d86c0915 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts:

	arch/sparc/kernel/of_device.c
2008-09-08 15:39:30 -07:00
Manfred Spraul e545a6140b kernel/cpu.c: create a CPU_STARTING cpu_chain notifier
Right now, there is no notifier that is called on a new cpu, before the new
cpu begins processing interrupts/softirqs.
Various kernel function would need that notification, e.g. kvm works around
by calling smp_call_function_single(), rcu polls cpu_online_map.

The patch adds a CPU_STARTING notification. It also adds a helper function
that sends the message to all cpu_chain handlers.

Tested on x86-64.
All other archs are untested. Especially on sparc, I'm not sure if I got
it right.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-09-08 19:25:24 +02:00
David S. Miller 81c4fdb1d6 sparc32: Kill remaining asm/mostek.h inclusions.
No longer needed.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-03 15:56:27 -07:00
David S. Miller c4cbe6f96e sparc32: use RTC subsystem
Use rtc subsystem for sparc32 architecture.
Actually, only one driver is needed: m48t59
as it supports the most common clocks on sparc32
machines: m48t08 and m48t02.

[ Add proper RTC layer calls to set_rtc_mmss() -DaveM ]

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-03 15:52:38 -07:00
David S. Miller 5280267c1d sparc: Fix handling of LANCE and ESP parent nodes in of_device.c
The device nodes that sit above 'esp' and 'le' on SBUS lack a 'ranges'
property, but we should pass the translation up to the parent node so
that the SBUS level ranges get applied.

Based upon a bug report from Robert Reif.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-03 02:05:19 -07:00
Adrian Bunk 5110bd21b8 sparc: remove CONFIG_SUN4
While doing some easy cleanups on the sparc code I noticed that the
CONFIG_SUN4 code seems to be worse than the rest - there were some
"I don't know how it should work, but the current code definitely cannot
work." places.

And while I have seen people running Linux on machines like a
SPARCstation 5 a few years ago I don't recall having seen sun4
machines, even less ones running Linux.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-31 20:59:37 -07:00
David S. Miller fd098316ef sparc: Annotate of_device_id arrays with const or __initdata.
As suggested by Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-31 01:23:17 -07:00
David S. Miller e0ac612e69 sparc: Kill ebus_bus_type.
No longer used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-30 00:37:36 -07:00
David S. Miller 356d164757 sparc: Kill EBUS driver layer.
All that remains is the EBUS DMA programming library for
sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-30 00:36:11 -07:00
David S. Miller 9dc69230a9 sparc: Kill now spurious includes of sbus.h
In order to make this week I also had to add an include
of linux/dma-mapping.h to asm/pci_32.h because drivers/pci/pci.c
really depends upon getting this header somehow.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:23 -07:00
David S. Miller 0ad626a2a4 sparc32: Kill iounit_map_dma_*().
Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:23 -07:00
David S. Miller 47a2d72885 sparc: Kill sbus_bus_type.
No longer used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:22 -07:00
David S. Miller 046e26a8ba sparc: Remove generic SBUS probing layer.
The individual SBUS IOMMU arch code now sets the IOMMU information
directly into the OF device objects.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:21 -07:00
David S. Miller 5059625ed8 sparc: Add OF archdata propagation helper.
Add a helper function that, given a bus of_device node, propagates
all iommu, stc, and host_controller values down to the child nodes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:20 -07:00
David S. Miller f8e4d32cb5 sparc: Kill sbus_arch_preinit().
32-bit sparc just needed it to register the ioport procfs bits, do this
via an arch_initcall() instead.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:19 -07:00
David S. Miller 615deeb27b sparc: Kill sbus_ioremap() and sbus_iounmap().
No more users.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:13 -07:00
David S. Miller 454eeb2dd7 sparc: Convert remaining sbus_ioremap() and sbus_iounmap() users.
Use of_ioremap() and of_iounmap() instead.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:13 -07:00
David S. Miller 98261dd1a3 sparc: Remove dinky old-style SBUS probing facilities.
No drivers or code uses this stuff any more, every driver has been
converted over to OF device probing.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:12 -07:00
David S. Miller 104364810f sparc: Remove SBUS layer resource and irq handling.
All the drivers use OF device objects now for this
information.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:11 -07:00
David S. Miller 33c4655c00 sparc: Kill SBUS layer IRQ hooks.
IRQs are obtained by drivers from the of_device struct.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:10 -07:00
David S. Miller 71d3721189 sparc32: Convert sun4d IRQ code to use generic device tree probing.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:09 -07:00
David S. Miller f1b6aa87b7 sparc32: Convert pmc to OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:09 -07:00
David S. Miller 7e7e2f0356 sparc32: Convert apc to OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:08 -07:00
David S. Miller 4b1c5df2af sparc32: Make mmu_map_dma_area and mmu_unmap_dma_area take a device pointer.
This lets us kill this "map it in every IOMMU" crazy code, and also
some of the final references to sbus_root.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:07 -07:00
David S. Miller aba945e76b sparc32: Kill mmu_translate_dvma() usage.
Just simply use virt_to_page() on the provided virtual address pointer.

Kill #if 0'd code.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:02 -07:00
David S. Miller 63237eeb5a sparc: Move SBUS DMA attribute interfaces out of asm/sbus.h
This is in preparation for the subsequent asm/sbus.h removal.

Also, make these routines take a "struct device" or no
arguments, as appropriate.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:31 -07:00
David S. Miller 738f2b7b81 sparc: Convert all SBUS drivers to dma_*() interfaces.
And all the SBUS dma interfaces are deleted.

A private implementation remains inside of the 32-bit sparc port which
exists only for the sake of the implementation of dma_*().

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:15 -07:00
David S. Miller 944c67dff7 sparc32: Implement more generic dma_*() interfaces.
These dispatch to either PCI or SBUS routines based upon
the device bus type.

This will allow us to let SBUS drivers call these routines.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:14 -07:00
David S. Miller 260489fa8a sparc32: Make mmu_{get,release}_*() take a struct device pointer.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:13 -07:00
David S. Miller 7a715f4601 sparc: Make SBUS DMA interfaces take struct device.
This is the first step in converting all the SBUS drivers
over to generic dma_*().

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:12 -07:00
David S. Miller e003934876 sparc32: Make IOMMU and IO-UNIT init work with device nodes.
And stick the iommu archdata pointer into the generic OF device tree
of_device struct as well.

We still have to pass the sbus_bus object down into the routines so
that the SBUS bus objects get the iommu cookies set properly.  After
drivers get converted to being pure OF drivers, that can go away.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:11 -07:00
David S. Miller 334ae61477 sparc: Kill SBUS DVMA layer.
This thing was completely pointless.

Just find the OF device in the parent of drivers that want to program
this device, and map the DMA regs inside such drivers too.

This also moves the dummy claim_dma_lock() and release_dma_lock()
implementation to floppy_32.h, which makes it handle this issue
just like floppy_64.h does.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:10 -07:00
David S. Miller 902663f6ea sparc: Delete bare sbus char bpp driver, obsoleted by parport_sunbpp
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:08 -07:00
David S. Miller e3c71a3291 sparc: Fix resource flags for PCI children in OF device tree.
When a device is under an EBUS or ISA bus, the resource flags
don't get set properly.

Fix this by re-evaluating the resource flags at each level of
bus as we apply ranges on the way to the root.  And let PCI
override any existing flags setting, but don't let the
default flags calculator make such overrides.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-28 22:59:10 -07:00
David S. Miller 66e4f8c076 sparc32: Implement smp_call_function_single().
Reported by Stephen Rothwell.

Needed to fix the build when CONFIG_RELAY is enabled.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-27 20:03:22 -07:00
David S. Miller 51e0f004a9 sparc64: Fix irq_of_parse_and_map() and irq_dispose_mapping().
Stephen Rothwell noticed that I committed an earlier version
of the patch that didn't have two things fixed:

1) irq_of_parse_and_map() should return "unsigned int" not "int"
   and it should return zero for "no irq"

2) irq_dispose_mapping() should be an inline function, not a macro,
   for type checking

With feedback and suggestions from Anton Vorontsov.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-25 16:44:58 -07:00
David S. Miller 44266215e3 sparc: Implement irq_of_parse_and_map() and irq_dispose_mapping().
This allows more OF layer code to be shared between powerpc and
sparc.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-24 20:33:55 -07:00
David S. Miller 2481d76615 sparc: Add mutex for set property calls.
On some platforms, the I2C controller is shared between the OS and
OBP.  OBP uses this I2C controller to access the EEPROM, and thus is
programmed when the kernel calls prom_setprop().

Wrap such calls with the new of_set_property_mutex.

Relevant I2C bus drivers can grab this mutex around top-level I2C
operations to provide the proper protection.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-24 20:33:55 -07:00
Stephen Rothwell 764f2579d9 sparc: don't use asm/of_device.h
Use linux/of_device.h instead.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-07 15:33:36 -07:00
David S. Miller b8b751bedc sparc: Add call to tracehook_signal_handler().
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-27 17:33:44 -07:00
David S. Miller 5a157d5bf8 sparc: Create and use TIF_NOTIFY_RESUME.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-27 17:33:37 -07:00
David S. Miller 1c133b4b3d sparc: Use tracehook routines in syscall_trace().
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-27 17:33:14 -07:00
David S. Miller f1373da87b sparc: Wire up new system calls.
This wires up the recently added Wire up signalfd4, eventfd2,
epoll_create1, dup3, pipe2, and inotify_init1 system calls.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-25 15:18:31 -07:00
Ulrich Drepper ed8cae8ba0 flag parameters: pipe
This patch introduces the new syscall pipe2 which is like pipe but it also
takes an additional parameter which takes a flag value.  This patch implements
the handling of O_CLOEXEC for the flag.  I did not add support for the new
syscall for the architectures which have a special sys_pipe implementation.  I
think the maintainers of those archs have the chance to go with the unified
implementation but that's up to them.

The implementation introduces do_pipe_flags.  I did that instead of changing
all callers of do_pipe because some of the callers are written in assembler.
I would probably screw up changing the assembly code.  To avoid breaking code
do_pipe is now a small wrapper around do_pipe_flags.  Once all callers are
changed over to do_pipe_flags the old do_pipe function can be removed.

The following test must be adjusted for architectures other than x86 and
x86-64 and in case the syscall numbers changed.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>

#ifndef __NR_pipe2
# ifdef __x86_64__
#  define __NR_pipe2 293
# elif defined __i386__
#  define __NR_pipe2 331
# else
#  error "need __NR_pipe2"
# endif
#endif

int
main (void)
{
  int fd[2];
  if (syscall (__NR_pipe2, fd, 0) != 0)
    {
      puts ("pipe2(0) failed");
      return 1;
    }
  for (int i = 0; i < 2; ++i)
    {
      int coe = fcntl (fd[i], F_GETFD);
      if (coe == -1)
        {
          puts ("fcntl failed");
          return 1;
        }
      if (coe & FD_CLOEXEC)
        {
          printf ("pipe2(0) set close-on-exit for fd[%d]\n", i);
          return 1;
        }
    }
  close (fd[0]);
  close (fd[1]);

  if (syscall (__NR_pipe2, fd, O_CLOEXEC) != 0)
    {
      puts ("pipe2(O_CLOEXEC) failed");
      return 1;
    }
  for (int i = 0; i < 2; ++i)
    {
      int coe = fcntl (fd[i], F_GETFD);
      if (coe == -1)
        {
          puts ("fcntl failed");
          return 1;
        }
      if ((coe & FD_CLOEXEC) == 0)
        {
          printf ("pipe2(O_CLOEXEC) does not set close-on-exit for fd[%d]\n", i);
          return 1;
        }
    }
  close (fd[0]);
  close (fd[1]);

  puts ("OK");

  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk.manpages@googlemail.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>
2008-07-24 10:47:28 -07:00
David Howells e4f25060b8 sparc: Remove Sparc's asm-offsets for sclow.S
Remove Sparc's asm-offsets for sclow.S as the (E)UID/(E)GID size and
offset definitions will cease to be correct if COW credentials are
merged.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-19 00:44:32 -07:00
David S. Miller 4fe3ebec12 sparc: Use new '%pS' infrastructure to print symbols.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-17 22:11:32 -07:00
Stoyan Gaydarov ab772027ca sparc: arch/sparc/kernel/apc.c to unlocked_ioctl
This changes arch/sparc/kernel/apc.c to use unlocked_ioctl

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-17 21:56:16 -07:00
Sam Ravnborg b1a8bf92a0 sparc: export openprom.h to userspace
sparc64 exports openprom.h to userspace so let sparc follow
the example.
As openprom.h pulled in another not-for-export vaddrs.h header
file it required a few changes to fix the build.

The definition af VMALLOC_* were moved to pgtable as this is
where sparc64 has them.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-17 21:42:23 -07:00
Adrian Bunk c61c65cdcd sparc/kernel/: possible cleanups
This patch contains the following possible cleanups:
- make the following needlessly global code static:
  - apc.c: apc_swift_idle()
  - ebus.c: ebus_blacklist_irq()
  - ebus.c: fill_ebus_child()
  - ebus.c: fill_ebus_device()
  - entry.S: syscall_is_too_hard
  - etra: tsetup_sun4c_stackchk
  - head.S: cputyp
  - head.S: prom_vector_p
  - idprom.c: Sun_Machines[]
  - ioport.c: _sparc_find_resource()
  - ioport.c: create_proc_read_entry()
  - irq.c: struct sparc_irq[]
  - rtrap.S: sun4c_rett_stackchk
  - setup.c: prom_sync_me()
  - setup.c: boot_flags
  - sun4c_irq.c: sun4c_sbint_to_irq()
  - sun4d_irq.c: sbus_tid[]
  - sun4d_irq.c: struct sbus_actions
  - sun4d_irq.c: sun4d_sbint_to_irq()
  - sun4m_irq.c: sun4m_sbint_to_irq()
  - sun4m_irq.c: sun4m_get_irqmask()
  - sun4m_irq.c: sun4m_timers
  - sun4m_smp.c: smp4m_cross_call()
  - sun4m_smp.c: smp4m_blackbox_id()
  - sun4m_smp.c: smp4m_blackbox_current()
  - time.c: sp_clock_typ
  - time.c: sbus_time_init()
  - traps.c: instruction_dump()
  - wof.S: spwin_sun4c_stackchk
  - wuf.S: sun4c_fwin_stackchk
- #if 0 the following unused code:
  - process.c: sparc_backtrace_lock
  - process.c: __show_backtrace()
  - process.c: show_backtrace()
  - process.c: smp_show_backtrace_all_cpus()
- remove the following unused code:
  - entry.S: __handle_exception
  - smp.c: smp_num_cpus
  - smp.c: smp_activated
  - smp.c: __cpu_number_map[]
  - smp.c: __cpu_logical_map[]
  - smp.c: bitops_spinlock
  - traps.c: trap_curbuf
  - traps.c: trapbuf[]
  - traps.c: linux_smp_still_initting
  - traps.c: thiscpus_tbr
  - traps.c: thiscpus_mid

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-17 21:37:46 -07:00
Jonathan Corbet 2fceef397f Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
Arnd Bergmann ee30d64e42 sparc-apc: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-07-02 15:06:25 -06:00
Alexey Dobriyan 399dc43bc2 sparc: switch /proc/led to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-03 15:21:21 -07:00