Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6:
  sparc: Set UTS_MACHINE correctly.
  sparc,leon: init_leon srmmu cleanup
  sparc32: Remove early interrupt enable.
  sparc, leon: Added Aeroflex Gaisler entry in manufacturer_info structure
  sparc64: Faster early-boot framebuffer console.
  Revert "sparc: Make atomic locks raw"
  sparc: remove unused nfsd #includes
  sparc: Fixup last users of irq_chip->typename
  Added sparc_leon3_snooping_enabled() and converted extern inline to static inline
  No auxio on LEON
  apbuart: Use of_find_node_by_path to find root node.
  sparc: Replace old style lock initializer
  sparc: Make atomic locks raw
  apbuart: Fix build and missing driver unregister.
  apbuart: Kill dependency on deprecated Sparc-only PROM interfaces.
  apbuart: Fix build warning.
  sparc: Support for GRLIB APBUART serial port
  watchdog: Remove BKL from rio watchdog driver
  sparc: Remove BKL from apc
  sparc,leon: Sparc-Leon SMP support
  • Loading branch information
Linus Torvalds committed Dec 8, 2009
2 parents a421018 + 7f5620a commit ee1262d
Show file tree
Hide file tree
Showing 30 changed files with 2,262 additions and 57 deletions.
7 changes: 7 additions & 0 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ config SPARC64_SMP
default y
depends on SPARC64 && SMP

config EARLYFB
bool "Support for early boot text console"
default y
depends on SPARC64
help
Say Y here to enable a faster early framebuffer boot console.

choice
prompt "Kernel page size" if SPARC64
default SPARC64_PAGE_SIZE_8KB
Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ AS := $(AS) -32
LDFLAGS := -m elf32_sparc
CHECKFLAGS += -D__sparc__
export BITS := 32
UTS_MACHINE := sparc

#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
Expand All @@ -46,6 +47,7 @@ CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64

LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64

KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
Expand Down
6 changes: 6 additions & 0 deletions arch/sparc/include/asm/btext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _SPARC_BTEXT_H
#define _SPARC_BTEXT_H

extern int btext_find_display(void);

#endif /* _SPARC_BTEXT_H */
45 changes: 40 additions & 5 deletions arch/sparc/include/asm/leon.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static inline unsigned long leon_load_reg(unsigned long paddr)
return retval;
}

extern inline void leon_srmmu_disabletlb(void)
static inline void leon_srmmu_disabletlb(void)
{
unsigned int retval;
__asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0),
Expand All @@ -158,7 +158,7 @@ extern inline void leon_srmmu_disabletlb(void)
"i"(ASI_LEON_MMUREGS) : "memory");
}

extern inline void leon_srmmu_enabletlb(void)
static inline void leon_srmmu_enabletlb(void)
{
unsigned int retval;
__asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0),
Expand Down Expand Up @@ -190,7 +190,7 @@ extern void leon_init_IRQ(void);

extern unsigned long last_valid_pfn;

extern inline unsigned long sparc_leon3_get_dcachecfg(void)
static inline unsigned long sparc_leon3_get_dcachecfg(void)
{
unsigned int retval;
__asm__ __volatile__("lda [%1] %2, %0\n\t" :
Expand All @@ -201,15 +201,22 @@ extern inline unsigned long sparc_leon3_get_dcachecfg(void)
}

/* enable snooping */
extern inline void sparc_leon3_enable_snooping(void)
static inline void sparc_leon3_enable_snooping(void)
{
__asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t"
"set 0x800000, %%l2\n\t"
"or %%l2, %%l1, %%l2\n\t"
"sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2");
};

extern inline void sparc_leon3_disable_cache(void)
static inline int sparc_leon3_snooping_enabled(void)
{
u32 cctrl;
__asm__ __volatile__("lda [%%g0] 2, %0\n\t" : "=r"(cctrl));
return (cctrl >> 23) & 1;
};

static inline void sparc_leon3_disable_cache(void)
{
__asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t"
"set 0x00000f, %%l2\n\t"
Expand Down Expand Up @@ -340,6 +347,30 @@ extern int leon_flush_needed(void);
extern void leon_switch_mm(void);
extern int srmmu_swprobe_trace;

#ifdef CONFIG_SMP
extern int leon_smp_nrcpus(void);
extern void leon_clear_profile_irq(int cpu);
extern void leon_smp_done(void);
extern void leon_boot_cpus(void);
extern int leon_boot_one_cpu(int i);
void leon_init_smp(void);
extern void cpu_probe(void);
extern void cpu_idle(void);
extern void init_IRQ(void);
extern void cpu_panic(void);
extern int __leon_processor_id(void);
void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu);

extern unsigned int real_irq_entry[], smpleon_ticker[];
extern unsigned int patchme_maybe_smp_msg[];
extern unsigned long trapbase_cpu1[];
extern unsigned long trapbase_cpu2[];
extern unsigned long trapbase_cpu3[];
extern unsigned int t_nmi[], linux_trap_ipi15_leon[];
extern unsigned int linux_trap_ipi15_sun4m[];

#endif /* CONFIG_SMP */

#endif /* __KERNEL__ */

#endif /* __ASSEMBLY__ */
Expand All @@ -356,6 +387,10 @@ extern int srmmu_swprobe_trace;
#define leon_switch_mm() do {} while (0)
#define leon_init_IRQ() do {} while (0)
#define init_leon() do {} while (0)
#define leon_smp_done() do {} while (0)
#define leon_boot_cpus() do {} while (0)
#define leon_boot_one_cpu(i) 1
#define leon_init_smp() do {} while (0)

#endif /* !defined(CONFIG_SPARC_LEON) */

Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/include/asm/rwsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct rw_semaphore {
#endif

#define __RWSEM_INITIALIZER(name) \
{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
__RWSEM_DEP_MAP_INIT(name) }
{ RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }

#define DECLARE_RWSEM(name) \
struct rw_semaphore name = __RWSEM_INITIALIZER(name)
Expand Down
9 changes: 9 additions & 0 deletions arch/sparc/include/asm/smp_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ static inline int hard_smp4d_processor_id(void)
return cpuid;
}

extern inline int hard_smpleon_processor_id(void)
{
int cpuid;
__asm__ __volatile__("rd %%asr17,%0\n\t"
"srl %0,28,%0" :
"=&r" (cpuid) : );
return cpuid;
}

#ifndef MODULE
static inline int hard_smp_processor_id(void)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ obj-y += dma.o
obj-$(CONFIG_SPARC32_PCI) += pcic.o

obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o
obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o
obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
obj-$(CONFIG_SPARC64_SMP) += hvtramp.o

obj-y += auxio_$(BITS).o
Expand All @@ -87,6 +87,7 @@ obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
CFLAGS_REMOVE_ftrace.o := -pg

obj-$(CONFIG_EARLYFB) += btext.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
# sparc64 PCI
obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o
Expand Down
37 changes: 10 additions & 27 deletions arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/smp_lock.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/of_device.h>
Expand Down Expand Up @@ -76,7 +75,6 @@ static inline void apc_free(struct of_device *op)

static int apc_open(struct inode *inode, struct file *f)
{
cycle_kernel_lock();
return 0;
}

Expand All @@ -87,61 +85,46 @@ static int apc_release(struct inode *inode, struct file *f)

static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg)
{
__u8 inarg, __user *arg;

arg = (__u8 __user *) __arg;

lock_kernel();
__u8 inarg, __user *arg = (__u8 __user *) __arg;

switch (cmd) {
case APCIOCGFANCTL:
if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg)) {
unlock_kernel();
if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg))
return -EFAULT;
}
break;

case APCIOCGCPWR:
if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg)) {
unlock_kernel();
if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg))
return -EFAULT;
}
break;

case APCIOCGBPORT:
if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg)) {
unlock_kernel();
if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg))
return -EFAULT;
}
break;

case APCIOCSFANCTL:
if (get_user(inarg, arg)) {
unlock_kernel();
if (get_user(inarg, arg))
return -EFAULT;
}
apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG);
break;

case APCIOCSCPWR:
if (get_user(inarg, arg)) {
unlock_kernel();
if (get_user(inarg, arg))
return -EFAULT;
}
apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG);
break;

case APCIOCSBPORT:
if (get_user(inarg, arg)) {
unlock_kernel();
if (get_user(inarg, arg))
return -EFAULT;
}
apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG);
break;

default:
unlock_kernel();
return -EINVAL;
};

unlock_kernel();
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/auxio_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void __init auxio_probe(void)
struct resource r;

switch (sparc_cpu_model) {
case sparc_leon:
case sun4d:
case sun4:
return;
Expand Down
Loading

0 comments on commit ee1262d

Please sign in to comment.