Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/dhowells/linux-2.6-mn10300

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300:
  MN10300: Clear ASB2364 peripheral interrupt masks before enabling interrupts
  MN10300: Fix the ASB2364 gdbport UART register defs
  MN10300: Fix ASB2364 FPGA register defs
  MN10300: Select GENERIC_HARDIRQS_NO_DEPRECATED
  MN10300: Select HAVE_GENERIC_HARDIRQS rather than GENERIC_HARDIRQS
  MN10300: Convert ASB2364 FPGA irq_chip to new functions
  MN10300: Convert ipi irq_chip to new functions
  MN10300: Convert serial irq_chip to new functions
  MN10300: Convert cpu irq_chips to new functions
  MN10300: Remove unused mn10300_intc_* functions
  MN10300: Remove stale irq_chip.end - V2
  MN10300: Use clockevents_calc_mult_shift()
  MN10300: Use clocksource_register_hz()
  MN10300: Remove stale code
  • Loading branch information
Linus Torvalds committed Mar 19, 2011
2 parents 664322a + ddb7d1e commit 2c1d247
Show file tree
Hide file tree
Showing 14 changed files with 159 additions and 219 deletions.
18 changes: 2 additions & 16 deletions arch/mn10300/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
config MN10300
def_bool y
select HAVE_OPROFILE
select GENERIC_HARDIRQS
select HAVE_GENERIC_HARDIRQS
select GENERIC_HARDIRQS_NO_DEPRECATED

config AM33_2
def_bool n
Expand Down Expand Up @@ -53,21 +54,6 @@ config GENERIC_TIME
config GENERIC_CLOCKEVENTS
def_bool y

config GENERIC_CLOCKEVENTS_BUILD
def_bool y
depends on GENERIC_CLOCKEVENTS

config GENERIC_CLOCKEVENTS_BROADCAST
bool

config CEVT_MN10300
def_bool y
depends on GENERIC_CLOCKEVENTS

config CSRC_MN10300
def_bool y
depends on GENERIC_TIME

config GENERIC_BUG
def_bool y

Expand Down
5 changes: 0 additions & 5 deletions arch/mn10300/include/asm/intctl-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@

#ifndef __ASSEMBLY__
extern void set_intr_level(int irq, u16 level);
extern void mn10300_intc_set_level(unsigned int irq, unsigned int level);
extern void mn10300_intc_clear(unsigned int irq);
extern void mn10300_intc_set(unsigned int irq);
extern void mn10300_intc_enable(unsigned int irq);
extern void mn10300_intc_disable(unsigned int irq);
extern void mn10300_set_lateack_irq_type(int irq);
#endif

Expand Down
5 changes: 2 additions & 3 deletions arch/mn10300/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ fpu-obj-$(CONFIG_FPU) := fpu.o fpu-low.o

obj-y := process.o signal.o entry.o traps.o irq.o \
ptrace.o setup.o time.o sys_mn10300.o io.o kthread.o \
switch_to.o mn10300_ksyms.o kernel_execve.o $(fpu-obj-y)
switch_to.o mn10300_ksyms.o kernel_execve.o $(fpu-obj-y) \
csrc-mn10300.o cevt-mn10300.o

obj-$(CONFIG_SMP) += smp.o smp-low.o

Expand All @@ -28,5 +29,3 @@ obj-$(CONFIG_MN10300_RTC) += rtc.o
obj-$(CONFIG_PROFILE) += profile.o profile-low.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_KPROBES) += kprobes.o
obj-$(CONFIG_CSRC_MN10300) += csrc-mn10300.o
obj-$(CONFIG_CEVT_MN10300) += cevt-mn10300.o
11 changes: 6 additions & 5 deletions arch/mn10300/kernel/cevt-mn10300.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ int __init init_clockevents(void)
cd->name = "Timestamp";
cd->features = CLOCK_EVT_FEAT_ONESHOT;

/* Calculate the min / max delta */
clockevent_set_clock(cd, MN10300_JCCLK);
/* Calculate shift/mult. We want to spawn at least 1 second */
clockevents_calc_mult_shift(cd, MN10300_JCCLK, 1);

/* Calculate the min / max delta */
cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd);
cd->min_delta_ns = clockevent_delta2ns(100, cd);

Expand All @@ -110,9 +111,9 @@ int __init init_clockevents(void)
#if defined(CONFIG_SMP) && !defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
/* setup timer irq affinity so it only runs on this cpu */
{
struct irq_desc *desc;
desc = irq_to_desc(cd->irq);
cpumask_copy(desc->affinity, cpumask_of(cpu));
struct irq_data *data;
data = irq_get_irq_data(cd->irq);
cpumask_copy(data->affinity, cpumask_of(cpu));
iact->flags |= IRQF_NOBALANCING;
}
#endif
Expand Down
3 changes: 1 addition & 2 deletions arch/mn10300/kernel/csrc-mn10300.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static struct clocksource clocksource_mn10300 = {
int __init init_clocksource(void)
{
startup_timestamp_counter();
clocksource_set_clock(&clocksource_mn10300, MN10300_TSCCLK);
clocksource_register(&clocksource_mn10300);
clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK);
return 0;
}
10 changes: 0 additions & 10 deletions arch/mn10300/kernel/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,3 @@ extern void mn10300_low_ipi_handler(void);
* time.c
*/
extern irqreturn_t local_timer_interrupt(void);

/*
* time.c
*/
#ifdef CONFIG_CEVT_MN10300
extern void clockevent_set_clock(struct clock_event_device *, unsigned int);
#endif
#ifdef CONFIG_CSRC_MN10300
extern void clocksource_set_clock(struct clocksource *, unsigned int);
#endif
91 changes: 35 additions & 56 deletions arch/mn10300/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ atomic_t irq_err_count;
/*
* MN10300 interrupt controller operations
*/
static void mn10300_cpupic_ack(unsigned int irq)
static void mn10300_cpupic_ack(struct irq_data *d)
{
unsigned int irq = d->irq;
unsigned long flags;
u16 tmp;

Expand All @@ -61,13 +62,14 @@ static void __mask_and_set_icr(unsigned int irq,
arch_local_irq_restore(flags);
}

static void mn10300_cpupic_mask(unsigned int irq)
static void mn10300_cpupic_mask(struct irq_data *d)
{
__mask_and_set_icr(irq, GxICR_LEVEL, 0);
__mask_and_set_icr(d->irq, GxICR_LEVEL, 0);
}

static void mn10300_cpupic_mask_ack(unsigned int irq)
static void mn10300_cpupic_mask_ack(struct irq_data *d)
{
unsigned int irq = d->irq;
#ifdef CONFIG_SMP
unsigned long flags;
u16 tmp;
Expand All @@ -85,7 +87,7 @@ static void mn10300_cpupic_mask_ack(unsigned int irq)
tmp2 = GxICR(irq);

irq_affinity_online[irq] =
any_online_cpu(*irq_desc[irq].affinity);
any_online_cpu(*d->affinity);
CROSS_GxICR(irq, irq_affinity_online[irq]) =
(tmp & (GxICR_LEVEL | GxICR_ENABLE)) | GxICR_DETECT;
tmp = CROSS_GxICR(irq, irq_affinity_online[irq]);
Expand All @@ -97,13 +99,14 @@ static void mn10300_cpupic_mask_ack(unsigned int irq)
#endif /* CONFIG_SMP */
}

static void mn10300_cpupic_unmask(unsigned int irq)
static void mn10300_cpupic_unmask(struct irq_data *d)
{
__mask_and_set_icr(irq, GxICR_LEVEL, GxICR_ENABLE);
__mask_and_set_icr(d->irq, GxICR_LEVEL, GxICR_ENABLE);
}

static void mn10300_cpupic_unmask_clear(unsigned int irq)
static void mn10300_cpupic_unmask_clear(struct irq_data *d)
{
unsigned int irq = d->irq;
/* the MN10300 PIC latches its interrupt request bit, even after the
* device has ceased to assert its interrupt line and the interrupt
* channel has been disabled in the PIC, so for level-triggered
Expand All @@ -121,7 +124,7 @@ static void mn10300_cpupic_unmask_clear(unsigned int irq)
} else {
tmp = GxICR(irq);

irq_affinity_online[irq] = any_online_cpu(*irq_desc[irq].affinity);
irq_affinity_online[irq] = any_online_cpu(*d->affinity);
CROSS_GxICR(irq, irq_affinity_online[irq]) = (tmp & GxICR_LEVEL) | GxICR_ENABLE | GxICR_DETECT;
tmp = CROSS_GxICR(irq, irq_affinity_online[irq]);
}
Expand All @@ -134,15 +137,16 @@ static void mn10300_cpupic_unmask_clear(unsigned int irq)

#ifdef CONFIG_SMP
static int
mn10300_cpupic_setaffinity(unsigned int irq, const struct cpumask *mask)
mn10300_cpupic_setaffinity(struct irq_data *d, const struct cpumask *mask,
bool force)
{
unsigned long flags;
int err;

flags = arch_local_cli_save();

/* check irq no */
switch (irq) {
switch (d->irq) {
case TMJCIRQ:
case RESCHEDULE_IPI:
case CALL_FUNC_SINGLE_IPI:
Expand Down Expand Up @@ -181,7 +185,7 @@ mn10300_cpupic_setaffinity(unsigned int irq, const struct cpumask *mask)
break;

default:
set_bit(irq, irq_affinity_request);
set_bit(d->irq, irq_affinity_request);
err = 0;
break;
}
Expand All @@ -202,15 +206,15 @@ mn10300_cpupic_setaffinity(unsigned int irq, const struct cpumask *mask)
* mask_ack() is provided), and mask_ack() just masks.
*/
static struct irq_chip mn10300_cpu_pic_level = {
.name = "cpu_l",
.disable = mn10300_cpupic_mask,
.enable = mn10300_cpupic_unmask_clear,
.ack = NULL,
.mask = mn10300_cpupic_mask,
.mask_ack = mn10300_cpupic_mask,
.unmask = mn10300_cpupic_unmask_clear,
.name = "cpu_l",
.irq_disable = mn10300_cpupic_mask,
.irq_enable = mn10300_cpupic_unmask_clear,
.irq_ack = NULL,
.irq_mask = mn10300_cpupic_mask,
.irq_mask_ack = mn10300_cpupic_mask,
.irq_unmask = mn10300_cpupic_unmask_clear,
#ifdef CONFIG_SMP
.set_affinity = mn10300_cpupic_setaffinity,
.irq_set_affinity = mn10300_cpupic_setaffinity,
#endif
};

Expand All @@ -220,15 +224,15 @@ static struct irq_chip mn10300_cpu_pic_level = {
* We use the latch clearing function of the PIC as the 'ACK' function.
*/
static struct irq_chip mn10300_cpu_pic_edge = {
.name = "cpu_e",
.disable = mn10300_cpupic_mask,
.enable = mn10300_cpupic_unmask,
.ack = mn10300_cpupic_ack,
.mask = mn10300_cpupic_mask,
.mask_ack = mn10300_cpupic_mask_ack,
.unmask = mn10300_cpupic_unmask,
.name = "cpu_e",
.irq_disable = mn10300_cpupic_mask,
.irq_enable = mn10300_cpupic_unmask,
.irq_ack = mn10300_cpupic_ack,
.irq_mask = mn10300_cpupic_mask,
.irq_mask_ack = mn10300_cpupic_mask_ack,
.irq_unmask = mn10300_cpupic_unmask,
#ifdef CONFIG_SMP
.set_affinity = mn10300_cpupic_setaffinity,
.irq_set_affinity = mn10300_cpupic_setaffinity,
#endif
};

Expand All @@ -252,31 +256,6 @@ void set_intr_level(int irq, u16 level)
__mask_and_set_icr(irq, GxICR_ENABLE, level);
}

void mn10300_intc_set_level(unsigned int irq, unsigned int level)
{
set_intr_level(irq, NUM2GxICR_LEVEL(level) & GxICR_LEVEL);
}

void mn10300_intc_clear(unsigned int irq)
{
__mask_and_set_icr(irq, GxICR_LEVEL | GxICR_ENABLE, GxICR_DETECT);
}

void mn10300_intc_set(unsigned int irq)
{
__mask_and_set_icr(irq, 0, GxICR_REQUEST | GxICR_DETECT);
}

void mn10300_intc_enable(unsigned int irq)
{
mn10300_cpupic_unmask(irq);
}

void mn10300_intc_disable(unsigned int irq)
{
mn10300_cpupic_mask(irq);
}

/*
* mark an interrupt to be ACK'd after interrupt handlers have been run rather
* than before
Expand All @@ -296,7 +275,7 @@ void __init init_IRQ(void)
int irq;

for (irq = 0; irq < NR_IRQS; irq++)
if (irq_desc[irq].chip == &no_irq_chip)
if (get_irq_chip(irq) == &no_irq_chip)
/* due to the PIC latching interrupt requests, even
* when the IRQ is disabled, IRQ_PENDING is superfluous
* and we can use handle_level_irq() for edge-triggered
Expand Down Expand Up @@ -384,12 +363,12 @@ int show_interrupts(struct seq_file *p, void *v)

if (i < NR_CPU_IRQS)
seq_printf(p, " %14s.%u",
irq_desc[i].chip->name,
irq_desc[i].irq_data.chip->name,
(GxICR(i) & GxICR_LEVEL) >>
GxICR_LEVEL_SHIFT);
else
seq_printf(p, " %14s",
irq_desc[i].chip->name);
irq_desc[i].irq_data.chip->name);

seq_printf(p, " %s", action->name);

Expand Down
16 changes: 10 additions & 6 deletions arch/mn10300/kernel/mn10300-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,21 @@ static void mn10300_serial_mask_ack(unsigned int irq)
arch_local_irq_restore(flags);
}

static void mn10300_serial_nop(unsigned int irq)
static void mn10300_serial_chip_mask_ack(struct irq_data *d)
{
mn10300_serial_mask_ack(d->irq);
}

static void mn10300_serial_nop(struct irq_data *d)
{
}

static struct irq_chip mn10300_serial_pic = {
.name = "mnserial",
.ack = mn10300_serial_mask_ack,
.mask = mn10300_serial_mask_ack,
.mask_ack = mn10300_serial_mask_ack,
.unmask = mn10300_serial_nop,
.end = mn10300_serial_nop,
.irq_ack = mn10300_serial_chip_mask_ack,
.irq_mask = mn10300_serial_chip_mask_ack,
.irq_mask_ack = mn10300_serial_chip_mask_ack,
.irq_unmask = mn10300_serial_nop,
};


Expand Down
Loading

0 comments on commit 2c1d247

Please sign in to comment.