Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  serial: sh-sci: remove duplicated #include
  sh: Export uncached helper symbols.
  sh: Fix up NUMA build for 29-bit.
  serial: sh-sci: Fix build failure for non-sh architectures.
  sh: Fix up uncached offset for legacy 29-bit mode.
  sh: Support CPU affinity masks for INTC controllers.
  • Loading branch information
Linus Torvalds committed Mar 20, 2010
2 parents b50df7d + 3f7581d commit e4d8063
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
7 changes: 7 additions & 0 deletions arch/sh/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ int pmb_unmap(void __iomem *addr);

#else

static inline int
pmb_bolt_mapping(unsigned long virt, phys_addr_t phys,
unsigned long size, pgprot_t prot)
{
return -EINVAL;
}

static inline void __iomem *
pmb_remap_caller(phys_addr_t phys, unsigned long size,
pgprot_t prot, void *caller)
Expand Down
9 changes: 9 additions & 0 deletions arch/sh/mm/uncached.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <linux/init.h>
#include <linux/module.h>
#include <asm/sizes.h>
#include <asm/page.h>
#include <asm/addrspace.h>

/*
* This is the offset of the uncached section from its cached alias.
Expand All @@ -15,15 +17,22 @@
unsigned long cached_to_uncached = SZ_512M;
unsigned long uncached_size = SZ_512M;
unsigned long uncached_start, uncached_end;
EXPORT_SYMBOL(uncached_start);
EXPORT_SYMBOL(uncached_end);

int virt_addr_uncached(unsigned long kaddr)
{
return (kaddr >= uncached_start) && (kaddr < uncached_end);
}
EXPORT_SYMBOL(virt_addr_uncached);

void __init uncached_init(void)
{
#ifdef CONFIG_29BIT
uncached_start = P2SEG;
#else
uncached_start = memory_end;
#endif
uncached_end = uncached_start + uncached_size;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include <linux/list.h>
#include <linux/dmaengine.h>
#include <linux/scatterlist.h>
#include <linux/timer.h>

#ifdef CONFIG_SUPERH
#include <asm/sh_bios.h>
Expand Down
31 changes: 30 additions & 1 deletion drivers/sh/intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Shared interrupt handling code for IPR and INTC2 types of IRQs.
*
* Copyright (C) 2007, 2008 Magnus Damm
* Copyright (C) 2009 Paul Mundt
* Copyright (C) 2009, 2010 Paul Mundt
*
* Based on intc2.c and ipr.c
*
Expand All @@ -26,6 +26,7 @@
#include <linux/list.h>
#include <linux/topology.h>
#include <linux/bitmap.h>
#include <linux/cpumask.h>

#define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \
((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \
Expand Down Expand Up @@ -234,6 +235,10 @@ static inline void _intc_enable(unsigned int irq, unsigned long handle)
unsigned int cpu;

for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) {
#ifdef CONFIG_SMP
if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity))
continue;
#endif
addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu);
intc_enable_fns[_INTC_MODE(handle)](addr, handle, intc_reg_fns\
[_INTC_FN(handle)], irq);
Expand All @@ -253,6 +258,10 @@ static void intc_disable(unsigned int irq)
unsigned int cpu;

for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) {
#ifdef CONFIG_SMP
if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity))
continue;
#endif
addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu);
intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\
[_INTC_FN(handle)], irq);
Expand Down Expand Up @@ -301,6 +310,23 @@ static int intc_set_wake(unsigned int irq, unsigned int on)
return 0; /* allow wakeup, but setup hardware in intc_suspend() */
}

#ifdef CONFIG_SMP
/*
* This is held with the irq desc lock held, so we don't require any
* additional locking here at the intc desc level. The affinity mask is
* later tested in the enable/disable paths.
*/
static int intc_set_affinity(unsigned int irq, const struct cpumask *cpumask)
{
if (!cpumask_intersects(cpumask, cpu_online_mask))
return -1;

cpumask_copy(irq_to_desc(irq)->affinity, cpumask);

return 0;
}
#endif

static void intc_mask_ack(unsigned int irq)
{
struct intc_desc_int *d = get_intc_desc(irq);
Expand Down Expand Up @@ -847,6 +873,9 @@ void __init register_intc_controller(struct intc_desc *desc)
d->chip.shutdown = intc_disable;
d->chip.set_type = intc_set_sense;
d->chip.set_wake = intc_set_wake;
#ifdef CONFIG_SMP
d->chip.set_affinity = intc_set_affinity;
#endif

if (hw->ack_regs) {
for (i = 0; i < hw->nr_ack_regs; i++)
Expand Down
4 changes: 4 additions & 0 deletions include/linux/serial_sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#define __LINUX_SERIAL_SCI_H

#include <linux/serial_core.h>
#ifdef CONFIG_SERIAL_SH_SCI_DMA
#include <asm/dmaengine.h>
#endif

/*
* Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
Expand Down Expand Up @@ -30,8 +32,10 @@ struct plat_sci_port {
upf_t flags; /* UPF_* flags */
char *clk; /* clock string */
struct device *dma_dev;
#ifdef CONFIG_SERIAL_SH_SCI_DMA
enum sh_dmae_slave_chan_id dma_slave_tx;
enum sh_dmae_slave_chan_id dma_slave_rx;
#endif
};

#endif /* __LINUX_SERIAL_SCI_H */

0 comments on commit e4d8063

Please sign in to comment.