Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc32, leon: bugfix in LEON SMP interrupt init
  sparc32, sun4m: bugfix in SMP IPI traphandler
  sparc: Remove unnecessary semicolons
  Add support for allocating irqs for bootbus devices
  Do not skip interrupt sources in sun4d interrupt handler and acknowledge interrupts correctly
  Restructure sun4d_build_device_irq so that timer interrupts can be allocated
  sparc: PCIC_PCI needs SPARC32 dependency
  sparc: Do not select GENERIC_HARDIRQS_NO_DEPRECATED
  sparc32,leon: add GRPCI2 PCI Host driver
  sparc32,leon: added LEON-common low-level PCI routines
  sparc32: added CONFIG_PCIC_PCI Kconfig setting
  • Loading branch information
Linus Torvalds committed Jun 9, 2011
2 parents 6aeccec + 10f0d07 commit 7f45e5c
Show file tree
Hide file tree
Showing 46 changed files with 1,401 additions and 117 deletions.
18 changes: 17 additions & 1 deletion arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ config SPARC
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

Expand Down Expand Up @@ -528,6 +527,23 @@ config PCI_DOMAINS
config PCI_SYSCALL
def_bool PCI

config PCIC_PCI
bool
depends on PCI && SPARC32 && !SPARC_LEON
default y

config LEON_PCI
bool
depends on PCI && SPARC_LEON
default y

config GRPCI2
bool "GRPCI2 Host Bridge Support"
depends on LEON_PCI
default y
help
Say Y here to include the GRPCI2 Host Bridge Driver.

source "drivers/pci/Kconfig"

source "drivers/pcmcia/Kconfig"
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc/include/asm/floppy_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static unsigned char sun_82072_fd_inb(int port)
return sun_fdc->data_82072;
case 7: /* FD_DIR */
return sun_read_dir();
};
}
panic("sun_82072_fd_inb: How did I get here?");
}

Expand All @@ -161,7 +161,7 @@ static void sun_82072_fd_outb(unsigned char value, int port)
case 4: /* FD_STATUS */
sun_fdc->status_82072 = value;
break;
};
}
return;
}

Expand All @@ -186,7 +186,7 @@ static unsigned char sun_82077_fd_inb(int port)
return sun_fdc->data_82077;
case 7: /* FD_DIR */
return sun_read_dir();
};
}
panic("sun_82077_fd_inb: How did I get here?");
}

Expand All @@ -212,7 +212,7 @@ static void sun_82077_fd_outb(unsigned char value, int port)
case 3: /* FD_TDR */
sun_fdc->tapectl_82077 = value;
break;
};
}
return;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/include/asm/floppy_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static unsigned char sun_82077_fd_inb(unsigned long port)
case 7: /* FD_DIR */
/* XXX: Is DCL on 0x80 in sun4m? */
return sbus_readb(&sun_fdc->dir_82077);
};
}
panic("sun_82072_fd_inb: How did I get here?");
}

Expand All @@ -135,7 +135,7 @@ static void sun_82077_fd_outb(unsigned char value, unsigned long port)
case 4: /* FD_STATUS */
sbus_writeb(value, &sun_fdc->status_82077);
break;
};
}
return;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/sparc/include/asm/leon.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ 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 void leon_update_virq_handling(unsigned int virq,
irq_flow_handler_t flow_handler,
const char *name, int do_ack);
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 Down
21 changes: 21 additions & 0 deletions arch/sparc/include/asm/leon_pci.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* asm/leon_pci.h
*
* Copyright (C) 2011 Aeroflex Gaisler AB, Daniel Hellstrom
*/

#ifndef _ASM_LEON_PCI_H_
#define _ASM_LEON_PCI_H_

/* PCI related definitions */
struct leon_pci_info {
struct pci_ops *ops;
struct resource io_space;
struct resource mem_space;
int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
};

extern void leon_pci_init(struct platform_device *ofdev,
struct leon_pci_info *info);

#endif /* _ASM_LEON_PCI_H_ */
24 changes: 24 additions & 0 deletions arch/sparc/include/asm/pci_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,31 @@ extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);

#endif /* __KERNEL__ */

#ifndef CONFIG_LEON_PCI
/* generic pci stuff */
#include <asm-generic/pci.h>
#else
/*
* On LEON PCI Memory space is mapped 1:1 with physical address space.
*
* I/O space is located at low 64Kbytes in PCI I/O space. The I/O addresses
* are converted into CPU addresses to virtual addresses that are mapped with
* MMU to the PCI Host PCI I/O space window which are translated to the low
* 64Kbytes by the Host controller.
*/

extern void
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
struct resource *res);

extern void
pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region);

static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
{
return PCI_IRQ_NONE;
}
#endif

#endif /* __SPARC_PCI_H */
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/pcic.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct linux_pcic {
int pcic_imdim;
};

#ifdef CONFIG_PCI
#ifdef CONFIG_PCIC_PCI
extern int pcic_present(void);
extern int pcic_probe(void);
extern void pci_time_init(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/system_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int
switch (size) {
case 4:
return xchg_u32(ptr, x);
};
}
__xchg_called_with_bad_pointer();
return x;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/system_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
return xchg32(ptr, x);
case 8:
return xchg64(ptr, x);
};
}
__xchg_called_with_bad_pointer();
return x;
}
Expand Down
4 changes: 3 additions & 1 deletion arch/sparc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ obj-$(CONFIG_SPARC64_SMP) += cpumap.o

obj-y += dma.o

obj-$(CONFIG_SPARC32_PCI) += pcic.o
obj-$(CONFIG_PCIC_PCI) += pcic.o
obj-$(CONFIG_LEON_PCI) += leon_pci.o
obj-$(CONFIG_GRPCI2) += leon_pci_grpci2.o

obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o
obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg)

default:
return -EINVAL;
};
}

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/auxio_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void set_auxio(unsigned char bits_on, unsigned char bits_off)
break;
default:
panic("Can't set AUXIO register on this machine.");
};
}
spin_unlock_irqrestore(&auxio_lock, flags);
}
EXPORT_SYMBOL(set_auxio);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/chmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static void chmc_interpret_one_decode_reg(struct chmc *p, int which_bank, u64 va
case 0x0:
bp->interleave = 16;
break;
};
}

/* UK[10] is reserved, and UK[11] is not set for the SDRAM
* bank size definition.
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ real_irq_entry:
#ifdef CONFIG_SMP
.globl patchme_maybe_smp_msg

cmp %l7, 12
cmp %l7, 11
patchme_maybe_smp_msg:
bgu maybe_smp4m_msg
nop
Expand Down Expand Up @@ -293,7 +293,7 @@ maybe_smp4m_msg:
WRITE_PAUSE
wr %l4, PSR_ET, %psr
WRITE_PAUSE
sll %o2, 28, %o2 ! shift for simpler checks below
sll %o3, 28, %o2 ! shift for simpler checks below
maybe_smp4m_msg_check_single:
andcc %o2, 0x1, %g0
beq,a maybe_smp4m_msg_check_mask
Expand Down Expand Up @@ -1604,7 +1604,7 @@ restore_current:
retl
nop

#ifdef CONFIG_PCI
#ifdef CONFIG_PCIC_PCI
#include <asm/pcic.h>

.align 4
Expand Down Expand Up @@ -1650,7 +1650,7 @@ pcic_nmi_trap_patch:
rd %psr, %l0
.word 0

#endif /* CONFIG_PCI */
#endif /* CONFIG_PCIC_PCI */

.globl flushw_all
flushw_all:
Expand Down
31 changes: 31 additions & 0 deletions arch/sparc/kernel/leon_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ static unsigned int _leon_build_device_irq(struct platform_device *op,
return leon_build_device_irq(real_irq, handle_simple_irq, "edge", 0);
}

void leon_update_virq_handling(unsigned int virq,
irq_flow_handler_t flow_handler,
const char *name, int do_ack)
{
unsigned long mask = (unsigned long)irq_get_chip_data(virq);

mask &= ~LEON_DO_ACK_HW;
if (do_ack)
mask |= LEON_DO_ACK_HW;

irq_set_chip_and_handler_name(virq, &leon_irq,
flow_handler, name);
irq_set_chip_data(virq, (void *)mask);
}

void __init leon_init_timers(irq_handler_t counter_fn)
{
int irq, eirq;
Expand Down Expand Up @@ -361,6 +376,22 @@ void __init leon_init_timers(irq_handler_t counter_fn)
prom_halt();
}

#ifdef CONFIG_SMP
{
unsigned long flags;

/*
* In SMP, sun4m adds a IPI handler to IRQ trap handler that
* LEON never must take, sun4d and LEON overwrites the branch
* with a NOP.
*/
local_irq_save(flags);
patchme_maybe_smp_msg[0] = 0x01000000; /* NOP out the branch */
local_flush_cache_all();
local_irq_restore(flags);
}
#endif

LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx].ctrl,
LEON3_GPTIMER_EN |
LEON3_GPTIMER_RL |
Expand Down
Loading

0 comments on commit 7f45e5c

Please sign in to comment.