Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247911
b: refs/heads/master
c: 21dccdd
h: refs/heads/master
i:
  247909: 8881f19
  247907: 6c970e1
  247903: dc2b66c
v: v3
  • Loading branch information
Jan Andersson authored and David S. Miller committed May 12, 2011
1 parent 01b44d2 commit 0a20404
Show file tree
Hide file tree
Showing 56 changed files with 1,711 additions and 1,550 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d81f087f1f1c1aacdb4f17224a554237285ddd11
refs/heads/master: 21dccddf45aae2d9f973696ce06115da0d1012b6
7 changes: 3 additions & 4 deletions trunk/arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ config SPARC
select HAVE_DMA_ATTRS
select HAVE_DMA_API_DEBUG
select HAVE_ARCH_JUMP_LABEL
select HAVE_GENERIC_HARDIRQS
select GENERIC_HARDIRQS_NO_DEPRECATED
select GENERIC_IRQ_SHOW
select USE_GENERIC_SMP_HELPERS if SMP

config SPARC32
def_bool !64BIT
Expand All @@ -47,12 +43,15 @@ config SPARC64
select HAVE_DYNAMIC_FTRACE
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_SYSCALL_TRACEPOINTS
select USE_GENERIC_SMP_HELPERS if SMP
select RTC_DRV_CMOS
select RTC_DRV_BQ4802
select RTC_DRV_SUN4V
select RTC_DRV_STARFIRE
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_GENERIC_HARDIRQS
select GENERIC_IRQ_SHOW
select IRQ_PREFLOW_FASTEOI

config ARCH_DEFCONFIG
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/sparc/include/asm/cpudata_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@ typedef struct {
unsigned long clock_tick;
unsigned int multiplier;
unsigned int counter;
#ifdef CONFIG_SMP
unsigned int irq_resched_count;
unsigned int irq_call_count;
#endif
int prom_node;
int mid;
int next;
} cpuinfo_sparc;

DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
#define local_cpu_data() __get_cpu_var(__cpu_data)

#endif /* _SPARC_CPUDATA_H */
40 changes: 11 additions & 29 deletions trunk/arch/sparc/include/asm/floppy_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,34 +281,36 @@ static inline void sun_fd_enable_dma(void)
pdma_areasize = pdma_size;
}

extern int sparc_floppy_request_irq(unsigned int irq,
irq_handler_t irq_handler);
/* Our low-level entry point in arch/sparc/kernel/entry.S */
extern int sparc_floppy_request_irq(int irq, unsigned long flags,
irq_handler_t irq_handler);

static int sun_fd_request_irq(void)
{
static int once = 0;
int error;

if (!once) {
if(!once) {
once = 1;
return sparc_floppy_request_irq(FLOPPY_IRQ, floppy_interrupt);
} else {
return 0;
}
error = sparc_floppy_request_irq(FLOPPY_IRQ,
IRQF_DISABLED,
floppy_interrupt);
return ((error == 0) ? 0 : -1);
} else return 0;
}

static struct linux_prom_registers fd_regs[2];

static int sun_floppy_init(void)
{
struct platform_device *op;
struct device_node *dp;
char state[128];
phandle tnode, fd_node;
int num_regs;
struct resource r;

use_virtual_dma = 1;

FLOPPY_IRQ = 11;
/* Forget it if we aren't on a machine that could possibly
* ever have a floppy drive.
*/
Expand Down Expand Up @@ -347,26 +349,6 @@ static int sun_floppy_init(void)
sun_fdc = (struct sun_flpy_controller *)
of_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");

/* Look up irq in platform_device.
* We try "SUNW,fdtwo" and "fd"
*/
for_each_node_by_name(dp, "SUNW,fdtwo") {
op = of_find_device_by_node(dp);
if (op)
break;
}
if (!op) {
for_each_node_by_name(dp, "fd") {
op = of_find_device_by_node(dp);
if (op)
break;
}
}
if (!op)
goto no_sun_fdc;

FLOPPY_IRQ = op->archdata.irqs[0];

/* Last minute sanity check... */
if(sun_fdc->status_82072 == 0xff) {
sun_fdc = NULL;
Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/sparc/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,17 @@
#else
#include <asm/io_32.h>
#endif

/*
* Defines used for both SPARC32 and SPARC64
*/

/* Big endian versions of memory read/write routines */
#define readb_be(__addr) __raw_readb(__addr)
#define readw_be(__addr) __raw_readw(__addr)
#define readl_be(__addr) __raw_readl(__addr)
#define writeb_be(__b, __addr) __raw_writeb(__b, __addr)
#define writel_be(__w, __addr) __raw_writel(__w, __addr)
#define writew_be(__l, __addr) __raw_writew(__l, __addr)

#endif
6 changes: 1 addition & 5 deletions trunk/arch/sparc/include/asm/irq_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
#ifndef _SPARC_IRQ_H
#define _SPARC_IRQ_H

/* Allocated number of logical irq numbers.
* sun4d boxes (ss2000e) should be OK with ~32.
* Be on the safe side and make room for 64
*/
#define NR_IRQS 64
#define NR_IRQS 16

#include <linux/interrupt.h>

Expand Down
41 changes: 31 additions & 10 deletions trunk/arch/sparc/include/asm/leon.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@
#define LEON_DIAGF_VALID 0x2000
#define LEON_DIAGF_VALID_SHIFT 13

/*
* Interrupt Sources
*
* The interrupt source numbers directly map to the trap type and to
* the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask,
* and the Interrupt Pending Registers.
*/
#define LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR 1
#define LEON_INTERRUPT_UART_1_RX_TX 2
#define LEON_INTERRUPT_UART_0_RX_TX 3
#define LEON_INTERRUPT_EXTERNAL_0 4
#define LEON_INTERRUPT_EXTERNAL_1 5
#define LEON_INTERRUPT_EXTERNAL_2 6
#define LEON_INTERRUPT_EXTERNAL_3 7
#define LEON_INTERRUPT_TIMER1 8
#define LEON_INTERRUPT_TIMER2 9
#define LEON_INTERRUPT_EMPTY1 10
#define LEON_INTERRUPT_EMPTY2 11
#define LEON_INTERRUPT_OPEN_ETH 12
#define LEON_INTERRUPT_EMPTY4 13
#define LEON_INTERRUPT_EMPTY5 14
#define LEON_INTERRUPT_EMPTY6 15

/* irq masks */
#define LEON_HARD_INT(x) (1 << (x)) /* irq 0-15 */
#define LEON_IRQMASK_R 0x0000fffe /* bit 15- 1 of lregs.irqmask */
Expand Down Expand Up @@ -160,6 +183,7 @@ static inline void leon_srmmu_enabletlb(void)
/* macro access for leon_readnobuffer_reg() */
#define LEON_BYPASSCACHE_LOAD_VA(x) leon_readnobuffer_reg((unsigned long)(x))

extern void sparc_leon_eirq_register(int eirq);
extern void leon_init(void);
extern void leon_switch_mm(void);
extern void leon_init_IRQ(void);
Expand Down Expand Up @@ -215,8 +239,8 @@ static inline int sparc_leon3_cpuid(void)
#endif /*!__ASSEMBLY__*/

#ifdef CONFIG_SMP
# define LEON3_IRQ_IPI_DEFAULT 13
# define LEON3_IRQ_TICKER (leon3_ticker_irq)
# define LEON3_IRQ_RESCHEDULE 13
# define LEON3_IRQ_TICKER (leon_percpu_timer_dev[0].irq)
# define LEON3_IRQ_CROSS_CALL 15
#endif

Expand Down Expand Up @@ -315,9 +339,9 @@ struct leon2_cacheregs {
#include <linux/interrupt.h>

struct device_node;
extern unsigned int leon_build_device_irq(unsigned int real_irq,
irq_flow_handler_t flow_handler,
const char *name, int do_ack);
extern int sparc_leon_eirq_get(int eirq, int cpu);
extern irqreturn_t sparc_leon_eirq_isr(int dummy, void *dev_id);
extern void sparc_leon_eirq_register(int eirq);
extern void leon_clear_clock_irq(void);
extern void leon_load_profile_irq(int cpu, unsigned int limit);
extern void leon_init_timers(irq_handler_t counter_fn);
Expand All @@ -334,7 +358,6 @@ extern void leon3_getCacheRegs(struct leon3_cacheregs *regs);
extern int leon_flush_needed(void);
extern void leon_switch_mm(void);
extern int srmmu_swprobe_trace;
extern int leon3_ticker_irq;

#ifdef CONFIG_SMP
extern int leon_smp_nrcpus(void);
Expand All @@ -343,19 +366,17 @@ 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 irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused);

extern unsigned int real_irq_entry[];
extern unsigned int smpleon_ipi[];
extern unsigned int real_irq_entry[], smpleon_ticker[];
extern unsigned int patchme_maybe_smp_msg[];
extern unsigned int t_nmi[], linux_trap_ipi15_leon[];
extern unsigned int linux_trap_ipi15_sun4m[];
extern int leon_ipi_irq;

#endif /* CONFIG_SMP */

Expand Down
12 changes: 3 additions & 9 deletions trunk/arch/sparc/include/asm/pcic.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@ struct linux_pcic {
int pcic_imdim;
};

#ifdef CONFIG_PCI
extern int pcic_present(void);
extern int pcic_probe(void);
extern void pci_time_init(void);
/* Erm... MJ redefined pcibios_present() so that it does not work early. */
extern int pcic_present(void);
extern void sun4m_pci_init_IRQ(void);
#else
static inline int pcic_present(void) { return 0; }
static inline int pcic_probe(void) { return 0; }
static inline void pci_time_init(void) {}
static inline void sun4m_pci_init_IRQ(void) {}
#endif

#endif

/* Size of PCI I/O space which we relocate. */
Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/sparc/include/asm/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/

#include <linux/const.h>

#ifndef __ASSEMBLY__
#include <asm-generic/4level-fixup.h>

Expand Down Expand Up @@ -458,9 +456,9 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma,

#endif /* !(__ASSEMBLY__) */

#define VMALLOC_START _AC(0xfe600000,UL)
#define VMALLOC_START 0xfe600000
/* XXX Alter this when I get around to fixing sun4c - Anton */
#define VMALLOC_END _AC(0xffc00000,UL)
#define VMALLOC_END 0xffc00000


/* We provide our own get_unmapped_area to cope with VA holes for userland */
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sparc/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,6 @@ extern pmd_t swapper_low_pmd_dir[2048];
extern void paging_init(void);
extern unsigned long find_ecache_flush_span(unsigned long size);

struct seq_file;
extern void mmu_info(struct seq_file *);

/* These do nothing with the way I have things setup. */
#define mmu_lockarea(vaddr, len) (vaddr)
#define mmu_unlockarea(vaddr, len) do { } while(0)
Expand Down
12 changes: 0 additions & 12 deletions trunk/arch/sparc/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,4 @@
# define COMMAND_LINE_SIZE 256
#endif

#ifdef __KERNEL__

#ifdef CONFIG_SPARC32
/* The CPU that was used for booting
* Only sun4d + leon may have boot_cpu_id != 0
*/
extern unsigned char boot_cpu_id;
extern unsigned char boot_cpu_id4;
#endif

#endif /* __KERNEL__ */

#endif /* _SPARC_SETUP_H */
37 changes: 18 additions & 19 deletions trunk/arch/sparc/include/asm/smp_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,42 @@ void smp_callin(void);
void smp_boot_cpus(void);
void smp_store_cpu_info(int);

void smp_resched_interrupt(void);
void smp_call_function_single_interrupt(void);
void smp_call_function_interrupt(void);

struct seq_file;
void smp_bogo(struct seq_file *);
void smp_info(struct seq_file *);

BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long)
BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
BTFIXUPDEF_CALL(void, smp_ipi_resched, int);
BTFIXUPDEF_CALL(void, smp_ipi_single, int);
BTFIXUPDEF_CALL(void, smp_ipi_mask_one, int);
BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
BTFIXUPDEF_BLACKBOX(load_current)

#define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4)

static inline void xc0(smpfunc_t func) { smp_cross_call(func, *cpu_online_mask, 0, 0, 0, 0); }
static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); }
static inline void xc1(smpfunc_t func, unsigned long arg1)
{ smp_cross_call(func, *cpu_online_mask, arg1, 0, 0, 0); }
{ smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); }
static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, 0, 0); }
{ smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); }
static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3)
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, arg3, 0); }
{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); }
static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3, unsigned long arg4)
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, arg3, arg4); }
{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); }

static inline int smp_call_function(void (*func)(void *info), void *info, int wait)
{
xc1((smpfunc_t)func, (unsigned long)info);
return 0;
}

extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
void *info, int wait)
{
smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid),
(unsigned long) info, 0, 0, 0);
return 0;
}

static inline int cpu_logical_map(int cpu)
{
Expand Down Expand Up @@ -131,11 +135,6 @@ static inline int hard_smp_processor_id(void)
__asm__ __volatile__("lda [%g0] ASI_M_VIKING_TMP1, %0\n\t"
"nop; nop" :
"=&r" (cpuid));
- leon
__asm__ __volatile__( "rd %asr17, %0\n\t"
"srl %0, 0x1c, %0\n\t"
"nop\n\t" :
"=&r" (cpuid));
See btfixup.h and btfixupprep.c to understand how a blackbox works.
*/
__asm__ __volatile__("sethi %%hi(___b_hard_smp_processor_id), %0\n\t"
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/sparc/include/asm/smp_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ extern void cpu_play_dead(void);

extern void smp_fetch_global_regs(void);

struct seq_file;
void smp_bogo(struct seq_file *);
void smp_info(struct seq_file *);

#ifdef CONFIG_HOTPLUG_CPU
extern int __cpu_disable(void);
extern void __cpu_die(unsigned int cpu);
Expand Down
Loading

0 comments on commit 0a20404

Please sign in to comment.