Skip to content

Commit e98bae7

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6: (28 commits) sparc32: fix build, fix missing cpu_relax declaration SCHED_TTWU_QUEUE is not longer needed since sparc32 now implements IPI sparc32,leon: Remove unnecessary page_address calls in LEON DMA API. sparc: convert old cpumask API into new one sparc32, sun4d: Implemented SMP IPIs support for SUN4D machines sparc32, sun4m: Implemented SMP IPIs support for SUN4M machines sparc32,leon: Implemented SMP IPIs for LEON CPU sparc32: implement SMP IPIs using the generic functions sparc32,leon: SMP power down implementation sparc32,leon: added some SMP comments sparc: add {read,write}*_be routines sparc32,leon: don't rely on bootloader to mask IRQs sparc32,leon: operate on boot-cpu IRQ controller registers sparc32: always define boot_cpu_id sparc32: removed unused code, implemented by generic code sparc32: avoid build warning at mm/percpu.c:1647 sparc32: always register a PROM based early console sparc32: probe for cpu info only during startup sparc: consolidate show_cpuinfo in cpu.c sparc32,leon: implement genirq CPU affinity ...
2 parents 4b382d0 + f400bdb commit e98bae7

55 files changed

Lines changed: 1553 additions & 1684 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/sparc/Kconfig‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ config SPARC
2525
select HAVE_DMA_ATTRS
2626
select HAVE_DMA_API_DEBUG
2727
select HAVE_ARCH_JUMP_LABEL
28+
select HAVE_GENERIC_HARDIRQS
29+
select GENERIC_HARDIRQS_NO_DEPRECATED
30+
select GENERIC_IRQ_SHOW
31+
select USE_GENERIC_SMP_HELPERS if SMP
2832

2933
config SPARC32
3034
def_bool !64BIT
@@ -43,15 +47,12 @@ config SPARC64
4347
select HAVE_DYNAMIC_FTRACE
4448
select HAVE_FTRACE_MCOUNT_RECORD
4549
select HAVE_SYSCALL_TRACEPOINTS
46-
select USE_GENERIC_SMP_HELPERS if SMP
4750
select RTC_DRV_CMOS
4851
select RTC_DRV_BQ4802
4952
select RTC_DRV_SUN4V
5053
select RTC_DRV_STARFIRE
5154
select HAVE_PERF_EVENTS
5255
select PERF_USE_VMALLOC
53-
select HAVE_GENERIC_HARDIRQS
54-
select GENERIC_IRQ_SHOW
5556
select IRQ_PREFLOW_FASTEOI
5657

5758
config ARCH_DEFCONFIG

‎arch/sparc/include/asm/cpudata_32.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ typedef struct {
1616
unsigned long clock_tick;
1717
unsigned int multiplier;
1818
unsigned int counter;
19+
#ifdef CONFIG_SMP
20+
unsigned int irq_resched_count;
21+
unsigned int irq_call_count;
22+
#endif
1923
int prom_node;
2024
int mid;
2125
int next;
2226
} cpuinfo_sparc;
2327

2428
DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
2529
#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
30+
#define local_cpu_data() __get_cpu_var(__cpu_data)
2631

2732
#endif /* _SPARC_CPUDATA_H */

‎arch/sparc/include/asm/floppy_32.h‎

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,36 +281,34 @@ static inline void sun_fd_enable_dma(void)
281281
pdma_areasize = pdma_size;
282282
}
283283

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

288287
static int sun_fd_request_irq(void)
289288
{
290289
static int once = 0;
291-
int error;
292290

293-
if(!once) {
291+
if (!once) {
294292
once = 1;
295-
error = sparc_floppy_request_irq(FLOPPY_IRQ,
296-
IRQF_DISABLED,
297-
floppy_interrupt);
298-
return ((error == 0) ? 0 : -1);
299-
} else return 0;
293+
return sparc_floppy_request_irq(FLOPPY_IRQ, floppy_interrupt);
294+
} else {
295+
return 0;
296+
}
300297
}
301298

302299
static struct linux_prom_registers fd_regs[2];
303300

304301
static int sun_floppy_init(void)
305302
{
303+
struct platform_device *op;
304+
struct device_node *dp;
306305
char state[128];
307306
phandle tnode, fd_node;
308307
int num_regs;
309308
struct resource r;
310309

311310
use_virtual_dma = 1;
312311

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

350+
/* Look up irq in platform_device.
351+
* We try "SUNW,fdtwo" and "fd"
352+
*/
353+
for_each_node_by_name(dp, "SUNW,fdtwo") {
354+
op = of_find_device_by_node(dp);
355+
if (op)
356+
break;
357+
}
358+
if (!op) {
359+
for_each_node_by_name(dp, "fd") {
360+
op = of_find_device_by_node(dp);
361+
if (op)
362+
break;
363+
}
364+
}
365+
if (!op)
366+
goto no_sun_fdc;
367+
368+
FLOPPY_IRQ = op->archdata.irqs[0];
369+
352370
/* Last minute sanity check... */
353371
if(sun_fdc->status_82072 == 0xff) {
354372
sun_fdc = NULL;

‎arch/sparc/include/asm/io.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@
55
#else
66
#include <asm/io_32.h>
77
#endif
8+
9+
/*
10+
* Defines used for both SPARC32 and SPARC64
11+
*/
12+
13+
/* Big endian versions of memory read/write routines */
14+
#define readb_be(__addr) __raw_readb(__addr)
15+
#define readw_be(__addr) __raw_readw(__addr)
16+
#define readl_be(__addr) __raw_readl(__addr)
17+
#define writeb_be(__b, __addr) __raw_writeb(__b, __addr)
18+
#define writel_be(__w, __addr) __raw_writel(__w, __addr)
19+
#define writew_be(__l, __addr) __raw_writew(__l, __addr)
20+
821
#endif

‎arch/sparc/include/asm/irq_32.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
#ifndef _SPARC_IRQ_H
77
#define _SPARC_IRQ_H
88

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

1115
#include <linux/interrupt.h>
1216

‎arch/sparc/include/asm/leon.h‎

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,6 @@
5252
#define LEON_DIAGF_VALID 0x2000
5353
#define LEON_DIAGF_VALID_SHIFT 13
5454

55-
/*
56-
* Interrupt Sources
57-
*
58-
* The interrupt source numbers directly map to the trap type and to
59-
* the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask,
60-
* and the Interrupt Pending Registers.
61-
*/
62-
#define LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR 1
63-
#define LEON_INTERRUPT_UART_1_RX_TX 2
64-
#define LEON_INTERRUPT_UART_0_RX_TX 3
65-
#define LEON_INTERRUPT_EXTERNAL_0 4
66-
#define LEON_INTERRUPT_EXTERNAL_1 5
67-
#define LEON_INTERRUPT_EXTERNAL_2 6
68-
#define LEON_INTERRUPT_EXTERNAL_3 7
69-
#define LEON_INTERRUPT_TIMER1 8
70-
#define LEON_INTERRUPT_TIMER2 9
71-
#define LEON_INTERRUPT_EMPTY1 10
72-
#define LEON_INTERRUPT_EMPTY2 11
73-
#define LEON_INTERRUPT_OPEN_ETH 12
74-
#define LEON_INTERRUPT_EMPTY4 13
75-
#define LEON_INTERRUPT_EMPTY5 14
76-
#define LEON_INTERRUPT_EMPTY6 15
77-
7855
/* irq masks */
7956
#define LEON_HARD_INT(x) (1 << (x)) /* irq 0-15 */
8057
#define LEON_IRQMASK_R 0x0000fffe /* bit 15- 1 of lregs.irqmask */
@@ -183,7 +160,6 @@ static inline void leon_srmmu_enabletlb(void)
183160
/* macro access for leon_readnobuffer_reg() */
184161
#define LEON_BYPASSCACHE_LOAD_VA(x) leon_readnobuffer_reg((unsigned long)(x))
185162

186-
extern void sparc_leon_eirq_register(int eirq);
187163
extern void leon_init(void);
188164
extern void leon_switch_mm(void);
189165
extern void leon_init_IRQ(void);
@@ -239,8 +215,8 @@ static inline int sparc_leon3_cpuid(void)
239215
#endif /*!__ASSEMBLY__*/
240216

241217
#ifdef CONFIG_SMP
242-
# define LEON3_IRQ_RESCHEDULE 13
243-
# define LEON3_IRQ_TICKER (leon_percpu_timer_dev[0].irq)
218+
# define LEON3_IRQ_IPI_DEFAULT 13
219+
# define LEON3_IRQ_TICKER (leon3_ticker_irq)
244220
# define LEON3_IRQ_CROSS_CALL 15
245221
#endif
246222

@@ -339,9 +315,9 @@ struct leon2_cacheregs {
339315
#include <linux/interrupt.h>
340316

341317
struct device_node;
342-
extern int sparc_leon_eirq_get(int eirq, int cpu);
343-
extern irqreturn_t sparc_leon_eirq_isr(int dummy, void *dev_id);
344-
extern void sparc_leon_eirq_register(int eirq);
318+
extern unsigned int leon_build_device_irq(unsigned int real_irq,
319+
irq_flow_handler_t flow_handler,
320+
const char *name, int do_ack);
345321
extern void leon_clear_clock_irq(void);
346322
extern void leon_load_profile_irq(int cpu, unsigned int limit);
347323
extern void leon_init_timers(irq_handler_t counter_fn);
@@ -358,6 +334,7 @@ extern void leon3_getCacheRegs(struct leon3_cacheregs *regs);
358334
extern int leon_flush_needed(void);
359335
extern void leon_switch_mm(void);
360336
extern int srmmu_swprobe_trace;
337+
extern int leon3_ticker_irq;
361338

362339
#ifdef CONFIG_SMP
363340
extern int leon_smp_nrcpus(void);
@@ -366,17 +343,19 @@ extern void leon_smp_done(void);
366343
extern void leon_boot_cpus(void);
367344
extern int leon_boot_one_cpu(int i);
368345
void leon_init_smp(void);
369-
extern void cpu_probe(void);
370346
extern void cpu_idle(void);
371347
extern void init_IRQ(void);
372348
extern void cpu_panic(void);
373349
extern int __leon_processor_id(void);
374350
void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu);
351+
extern irqreturn_t leon_percpu_timer_interrupt(int irq, void *unused);
375352

376-
extern unsigned int real_irq_entry[], smpleon_ticker[];
353+
extern unsigned int real_irq_entry[];
354+
extern unsigned int smpleon_ipi[];
377355
extern unsigned int patchme_maybe_smp_msg[];
378356
extern unsigned int t_nmi[], linux_trap_ipi15_leon[];
379357
extern unsigned int linux_trap_ipi15_sun4m[];
358+
extern int leon_ipi_irq;
380359

381360
#endif /* CONFIG_SMP */
382361

‎arch/sparc/include/asm/pcic.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ struct linux_pcic {
2929
int pcic_imdim;
3030
};
3131

32-
extern int pcic_probe(void);
33-
/* Erm... MJ redefined pcibios_present() so that it does not work early. */
32+
#ifdef CONFIG_PCI
3433
extern int pcic_present(void);
34+
extern int pcic_probe(void);
35+
extern void pci_time_init(void);
3536
extern void sun4m_pci_init_IRQ(void);
36-
37+
#else
38+
static inline int pcic_present(void) { return 0; }
39+
static inline int pcic_probe(void) { return 0; }
40+
static inline void pci_time_init(void) {}
41+
static inline void sun4m_pci_init_IRQ(void) {}
42+
#endif
3743
#endif
3844

3945
/* Size of PCI I/O space which we relocate. */

‎arch/sparc/include/asm/pgtable_32.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
99
*/
1010

11+
#include <linux/const.h>
12+
1113
#ifndef __ASSEMBLY__
1214
#include <asm-generic/4level-fixup.h>
1315

@@ -456,9 +458,9 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma,
456458

457459
#endif /* !(__ASSEMBLY__) */
458460

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

463465

464466
/* We provide our own get_unmapped_area to cope with VA holes for userland */

‎arch/sparc/include/asm/pgtable_64.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ extern pmd_t swapper_low_pmd_dir[2048];
699699
extern void paging_init(void);
700700
extern unsigned long find_ecache_flush_span(unsigned long size);
701701

702+
struct seq_file;
703+
extern void mmu_info(struct seq_file *);
704+
702705
/* These do nothing with the way I have things setup. */
703706
#define mmu_lockarea(vaddr, len) (vaddr)
704707
#define mmu_unlockarea(vaddr, len) do { } while(0)

‎arch/sparc/include/asm/setup.h‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,16 @@
1111
# define COMMAND_LINE_SIZE 256
1212
#endif
1313

14+
#ifdef __KERNEL__
15+
16+
#ifdef CONFIG_SPARC32
17+
/* The CPU that was used for booting
18+
* Only sun4d + leon may have boot_cpu_id != 0
19+
*/
20+
extern unsigned char boot_cpu_id;
21+
extern unsigned char boot_cpu_id4;
22+
#endif
23+
24+
#endif /* __KERNEL__ */
25+
1426
#endif /* _SPARC_SETUP_H */

0 commit comments

Comments
 (0)