Commit graph

393 commits

Author SHA1 Message Date
Linus Torvalds 0278ef8b48 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (67 commits)
  [SCSI] SUNESP: Complete driver rewrite to version 2.0
  [SPARC64]: Convert PCI over to generic struct iommu/strbuf.
  [SPARC]: device_node name constification fallout
  [SPARC64]: Convert SBUS over to generic iommu/strbuf structs.
  [SPARC64]: Add generic iommu and strbuf structs to iommu.h
  [SPARC64]: Consolidate {sbus,pci}_iommu_arena.
  [SPARC]: Make device_node name and type const
  [SPARC64]: constify some paramaters of OF routines
  [TIGON3]: of_get_property() returns const.
  [SPARC64]: Fix PCI rework to adhere to of_get_property() const return.
  [SPARC64]: Document and fix calculation of pages_avail.
  [SPARC64]: Make sure pbm->prom_node is setup easly enough in psycho.c
  [SPARC64]: Use bootmem_bootmap_pages() in choose_bootmap_pfn().
  [SPARC64]: Add proper header file extern for cmdline_memory_size.
  [SPARC64]: Kill sparc_ultra_dump_{i,d}tlb()
  [SPARC64]: Use DECLARE_BITMAP and BITS_TO_LONGS in mm/init.c
  [SPARC64]: Give move verbose show_mem() output just like i386.
  [SPARC64]: Mark show_mem() printk's with KERN_INFO.
  [SPARC64]: Kill kvaddr_to_phys() and friends.
  [SPARC64]: Privatize sun4u_get_pte() and fix name.
  ...
2007-04-27 09:29:04 -07:00
David S. Miller 16ce82d846 [SPARC64]: Convert PCI over to generic struct iommu/strbuf.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 21:08:21 -07:00
David S. Miller 6687508809 [SPARC64]: Add generic iommu and strbuf structs to iommu.h
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:43 -07:00
David S. Miller 9b3627f389 [SPARC64]: Consolidate {sbus,pci}_iommu_arena.
Move to asm-sparc64/iommu.h and rename to plain "iommu_arena".

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:42 -07:00
Stephen Rothwell 711b360d64 [SPARC]: Make device_node name and type const
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:41 -07:00
Stephen Rothwell 3dfe10ee7c [SPARC64]: constify some paramaters of OF routines
This starts bringing the PowerPC and Sparc64 implemetations back closer
together.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:40 -07:00
David S. Miller b93f262023 [SPARC64]: Add proper header file extern for cmdline_memory_size.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:33 -07:00
David S. Miller 4be5c34dc4 [SPARC64]: Privatize sun4u_get_pte() and fix name.
__get_phys is only called from init.c as is prom_virt_to_phys(),
__get_iospace() is not called at all, and sun4u_get_pte() is largely
misnamed.

Privatize the implementation and helper functions of
sun4u_get_phys() to mm/init.c, and rename to
kvaddr_to_paddr().

The only used of this thing is flush_icache_range(), and thus
things can be considerably further simplified.  For example,
we should only see module or PAGE_OFFSET kernel addresses here,
so we don't need the OBP firmware range handling at all.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:26 -07:00
David S. Miller 4e286d5be6 [SPARC64]: MAX_PHYSADDR_BITS et al. really need to be 42 bits not 41.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:24 -07:00
David S. Miller d78d0891d3 [SPARC64]: Use SPARSEMEM_STATIC
Decrease the SECTION_SIZE_BITS --> MAX_PHYSADDR_BITS
range a little bit.

The cost of going to SPARSEMEM_STATIC becomes 8K of BSS space, and in
return we save a pointer dereferences on every page struct lookup.
Even better we hit the main kernel image for the base address which is
in a hugepage locked TLB entry.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:22 -07:00
David S. Miller 43bed12737 [SPARC64]: Use DECLARE_BITMAP in struct pci_iommu.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:21 -07:00
David S. Miller c6e87566ea [SPARC64]: Const'ify pci_iommu_ops.
Based upon a similar patch for x86_64 written by
Stephen Hemminger.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:18 -07:00
David S. Miller 0bba2dd823 [SPARC64]: Kill pbm->pci_first_slot.
Set but never used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:17 -07:00
David S. Miller 3875c5c02d [SPARC64]: Kill pci_controller->pbms_same_domain
We don't do the "Simba APB is a PBM" bogosity for Sabre
controllers any longer, so this pbms_same_domain thing
is no longer necessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:16 -07:00
David S. Miller 8d3aee9375 [SPARC64]: Kill pci_controller->base_address_update().
Implemented but never actually used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:15 -07:00
David S. Miller 0bae5f81b6 [SPARC64]: Kill pci_controller->resource_adjust()
All the implementations can be identical and generic, so
no need for controller specific methods.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:14 -07:00
David S. Miller 3487a1f9e7 [SPARC64]: Kill PBM ranges software state.
It is only used in one spot and we can just fetch the
OF property right there.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:13 -07:00
David S. Miller 229177c7f3 [SPARC64]: Kill PBM intmap software state.
Set but never used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:12 -07:00
David S. Miller 1e8a8cc52d [SPARC64]: Internalize pci_memspace_mask.
The only user was bus_dvma_to_mem() which is no longer used
by any driver, so kill that, and the export of pci_memspace_mask.

The only user now is the PCI mmap support code.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:07 -07:00
David S. Miller a2fb23af1c [SPARC64]: Probe PCI bus using OF device tree.
Almost entirely taken from the 64-bit PowerPC PCI code.

This allowed to eliminate a ton of cruft from the sparc64
PCI layer.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:06 -07:00
David S. Miller deb66c4521 [SPARC64] isa: Convert to use pci_device_to_OF_node().
Also, do not try to compute resources by hand, instead use
the pre-computed ones in the of_device.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:05 -07:00
David S. Miller 1327e9b62f [SPARC64] ebus: Convert to use pci_device_to_OF_node().
Also, we don't need to store or use the PBM so kill that
from the linux_ebus.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:04 -07:00
Stephen Rothwell 64b94701c0 [SPARC/64]: constify of_get_property return
Finally, we actually change the functions themselves.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:35 -07:00
Stephen Rothwell 66f3cb7ccf [SPARC64] constify of_get_property return: include
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:30 -07:00
David S. Miller 112f48716d [SPARC64]: Add clocksource/clockevents support.
I'd like to thank John Stul and others for helping
me along the way.

A lot of cleanups fell out of this.  For example, the get_compare()
tick_op was totally unused, so was deleted.  And the most often used
tick_op members were grouped together for cache-friendlyness.

The sparc64 TSC is given to the kernel as a one-shot timer.

tick_ops->init_timer() simply turns off the privileged bit in
the tick register (when possible), and disables the interrupt
by setting bit 63 in the compare register.  The ->disable_irq()
op also sets this bit.

tick_ops->add_compare() is changed to:

1) Add the given delta to "tick" not to "compare"
2) Return a boolean which, if true, means that the tick
   value read after writing the compare value was found
   to have incremented past the initial tick value.  This
   mirrors logic used in the HPET driver's ->next_event()
   method.

Each tick_ops implementation also now provides a name string.
And we feed this into the clocksource and clockevents layers.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:15 -07:00
David S. Miller 777a447529 [SPARC64]: Unify timer interrupt handler.
Things were scattered all over the place, split between
SMP and non-SMP.

Unify it all so that dyntick support is easier to add.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:11 -07:00
Eric Dumazet 92f37fd2ee [NET]: Adding SO_TIMESTAMPNS / SCM_TIMESTAMPNS support
Now that network timestamps use ktime_t infrastructure, we can add a new
SOL_SOCKET sockopt  SO_TIMESTAMPNS.

This command is similar to SO_TIMESTAMP, but permits transmission of
a 'timespec struct' instead of a 'timeval struct' control message.
(nanosecond resolution instead of microsecond)

Control message is labelled SCM_TIMESTAMPNS instead of SCM_TIMESTAMP

A socket cannot mix SO_TIMESTAMP and SO_TIMESTAMPNS : the two modes are
mutually exclusive.

sock_recv_timestamp() became too big to be fully inlined so I added a
__sock_recv_timestamp() helper function.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
CC: linux-arch@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:21 -07:00
Eric Dumazet ae40eb1ef3 [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution
Now network timestamps use ktime_t infrastructure, we can add a new
ioctl() SIOCGSTAMPNS command to get timestamps in 'struct timespec'.
User programs can thus access to nanosecond resolution.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
CC: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:04 -07:00
Robert Reif d80f0a4beb [SPARC]: Add unsigned to unused bit field in a.out.h
Add unsigned to unused bit field in a.out.h to make sparse happy.

[ I took care of the sparc64 side as well -DaveM ]

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-02 14:26:21 -07:00
Mikael Pettersson 7945d5626c [SPARC]: sparc64 gcc-4.2.0 20070317 -Werror failure
Compiling 2.6.21-rc5 with gcc-4.2.0 20070317 (prerelease)
for sparc64 fails as follows:

  gcc -Wp,-MD,arch/sparc64/kernel/.time.o.d  -nostdinc -isystem /home/mikpe/pkgs/linux-sparc64/gcc-4.2.0/lib/gcc/sparc64-unknown-linux-gnu/4.2.0/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -Werror   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)" -c -o arch/sparc64/kernel/time.o arch/sparc64/kernel/time.c
cc1: warnings being treated as errors
arch/sparc64/kernel/time.c: In function 'kick_start_clock':
arch/sparc64/kernel/time.c:559: warning: overflow in implicit constant conversion
make[1]: *** [arch/sparc64/kernel/time.o] Error 1
make: *** [arch/sparc64/kernel] Error 2

gcc gets unhappy when the MSTK_SET macro's u8 __val variable
is updated with &= ~0xff (MSTK_YEAR_MASK). Making the constant
unsigned fixes the problem.

[ I fixed up the sparc32 side as well -DaveM ]

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-27 01:13:55 -07:00
David S. Miller d1acb4210a [SPARC64]: Get DEBUG_PAGEALLOC working again.
We have to make sure to use base-pagesize TLB entries even during the
early transition period where we need TLB miss handling but don't have
the kernel page tables setup yet for the linear region.

Also, it is necessary therefore to not use the 4MB TSB for these
translations, and instead use the normal kernel TSB.  This allows us
to also get rid of the 4MB tsb for debug builds which shrinks the
kernel a little bit.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-16 17:20:28 -07:00
David S. Miller 50d266a3a1 [SPARC]: Hook up missing syscalls.
sys_mbind
sys_get_mempolicy
sys_set_mempolicy
sys_kexec_load
sys_move_pages
sys_getcpu
sys_epoll_pwait

This work is largely a result of David Woodhouse's most
excellent missing syscalls patch.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-12 19:58:18 -07:00
David S. Miller ac33d1febb [SPARC]: We do not need OLD_GETRLIMIT.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-09 23:10:23 -08:00
David S. Miller 2ef550790a [SPARC64]: Fix PARPORT build (again).
Need to provide {claim,release}_dma_lock() for this guy too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-08 15:00:03 -08:00
David S. Miller 78ad0b8408 [SPARC64]: Fix floppy build failure.
Just define a local {claim,release}_dma_lock() implementation
for the floppy driver to use so we don't need to define and
export to modules the silly dma_spin_lock.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-05 13:22:28 -08:00
David S. Miller c4c31fe0e2 [SPARC]: Provide 'get_property()' alias for of_get_property().
Another powerpc compatibility item, this will allow us to share
more code with them.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-02 15:22:53 -08:00
David S. Miller f6d0f9ea55 [SPARC]: Provide pci_device_to_OF_node() just like powerpc.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-02 15:22:51 -08:00
David S. Miller 74bd7d093b [SPARC64]: Fix parport_pc build.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-28 13:09:34 -08:00
David S. Miller b5ba1b31c7 [SPARC64]: Increase command line size to 2048 like other arches.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-12 15:15:47 -08:00
Linus Torvalds c827ba4cb4 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Update defconfig.
  [SPARC64]: Add PCI MSI support on Niagara.
  [SPARC64] IRQ: Use irq_desc->chip_data instead of irq_desc->handler_data
  [SPARC64]: Add obppath sysfs attribute for SBUS and PCI devices.
  [PARTITION]: Add whole_disk attribute.
2007-02-11 11:37:45 -08:00
Tilman Schmidt 4564f9e5fd [PATCH] consolidate line discipline number definitions
The line discipline numbers N_* are currently defined for each architecture
individually, but (except for a seeming mistake) identically, in
asm/termios.h.  There is no obvious reason why these numbers should be
architecture specific, nor any apparent relationship with the termios
structure.  The total number of these, NR_LDISCS, is defined in linux/tty.h
anyway.  So I propose the following patch which moves the definitions of
the individual line disciplines to linux/tty.h too.

Three of these numbers (N_MASC, N_PROFIBUS_FDL, and N_SMSBLOCK) are unused
in the current kernel, but the patch still keeps the complete set in case
there are plans to use them yet.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11 10:51:26 -08:00
David S. Miller 35a17eb6a8 [SPARC64]: Add PCI MSI support on Niagara.
This is kind of hokey, we could use the hardware provided facilities
much better.

MSIs are assosciated with MSI Queues.  MSI Queues generate interrupts
when any MSI assosciated with it is signalled.  This suggests a
two-tiered IRQ dispatch scheme:

	MSI Queue interrupt --> queue interrupt handler
		MSI dispatch --> driver interrupt handler

But we just get one-level under Linux currently.  What I'd like to do
is possibly stick the IRQ actions into a per-MSI-Queue data structure,
and dispatch them form there, but the generic IRQ layer doesn't
provide a way to do that right now.

So, the current kludge is to "ACK" the interrupt by processing the
MSI Queue data structures and ACK'ing them, then we run the actual
handler like normal.

We are wasting a lot of useful information, for example the MSI data
and address are provided with ever MSI, as well as a system tick if
available.  If we could pass this into the IRQ handler it could help
with certain things, in particular for PCI-Express error messages.

The MSI entries on sparc64 also tell you exactly which bus/device/fn
sent the MSI, which would be great for error handling when no
registered IRQ handler can service the interrupt.

We override the disable/enable IRQ chip methods in sun4v_msi, so we
have to call {mask,unmask}_msi_irq() directly from there.  This is
another ugly wart.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-10 23:50:37 -08:00
David S. Miller e3a411a3df [SPARC64]: Fix of_iounmap() region release.
We need to pass in the resource otherwise we cannot
release the region properly.  We must know whether it is
an I/O or MEM resource.

Spotted by Eric Brower.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-31 14:06:05 -08:00
David S. Miller 5a089006bf [SPARC64]: Mirror x86_64's PERCPU_ENOUGH_ROOM definition.
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-17 14:06:59 -08:00
David S. Miller 729e7d7e4d [SPARC64]: Minor irq handling cleanups.
Use struct irq_chip instead of hw_interrupt_type.

Delete hw_resend_irq(), totally unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-17 14:06:56 -08:00
Ralf Baechle ec8c0446b6 [PATCH] Optimize D-cache alias handling on fork
Virtually index, physically tagged cache architectures can get away
without cache flushing when forking.  This patch adds a new cache
flushing function flush_cache_dup_mm(struct mm_struct *) which for the
moment I've implemented to do the same thing on all architectures
except on MIPS where it's a no-op.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:27:08 -08:00
David S. Miller f088258966 [SPARC64]: Fix several kprobes bugs.
- relbranch_fixup(), for non-branches, would end up setting
  regs->tnpc incorrectly, in fact it would set it equal to
  regs->tpc which would cause that instruction to execute twice

  Also, if this is not a PC-relative branch, we should just
  leave regs->tnpc as-is.  This covers cases like 'jmpl' which
  branch to absolute values.

- To be absolutely %100 safe, we need to flush the instruction
  cache for all assignments to kprobe->ainsn.insn[], including
  cases like add_aggr_kprobe()

- prev_kprobe's status field needs to be 'unsigned long' to match
  the type of the value it is saving

- jprobes were totally broken:
  = jprobe_return() can run in the stack frame of the jprobe handler,
    or in an even deeper stack frame, thus we'll be in the wrong
    register window than the one from the original probe state.

    So unwind using 'restore' instructions, if necessary, right
    before we do the jprobe_return() breakpoint trap.

  = There is no reason to save/restore the register window saved
    at %sp at jprobe trigger time.  Those registers cannot be
    modified by the jprobe handler.  Also, this code was saving
    and restoring "sizeof (struct sparc_stackf)" bytes.  Depending
    upon the caller, this could clobber unrelated stack frame
    pieces if there is only a basic 128-byte register window
    stored on the stack, without the argument save area.

    So just saving and restoring struct pt_regs is sufficient.

  = Kill the "jprobe_saved_esp", totally unused.

    Also, delete "jprobe_saved_regs_location", with the stack frame
    unwind now done explicitly by jprobe_return(), this check is
    superfluous.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-10 02:42:03 -08:00
Mariusz Kozlowski 5ff42459af [SPARC64]: dma remove extra brackets
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-10 02:40:36 -08:00
David S. Miller 10e267234c [SPARC64]: Add irqtrace/stacktrace/lockdep support.
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-10 02:39:09 -08:00
Alan Cox be90038a24 [PATCH] tty: preparatory structures for termios revamp
In order to sort out our struct termios and add proper speed control we need
to separate the kernel and user termios structures.  Glibc is fine but the
other libraries rely on the kernel exported struct termios and we need to
extend this without breaking the ABI/API

To do so we add a struct ktermios which is the kernel view of a termios
structure and overlaps the struct termios with extra fields on the end for
now.  (That limitation will go away in later patches).  Some platforms (eg
alpha) planned ahead and thus use the same struct for both, others did not.

This just adds the structures but does not use them, it seems a sensible
splitting point for bisect if there are compile failures (not that I expect
them)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-08 08:28:56 -08:00