Release 4.14 arch/m68k/amiga/cia.c
/*
* linux/arch/m68k/amiga/cia.c - CIA support
*
* Copyright (C) 1996 Roman Zippel
*
* The concept of some functions bases on the original Amiga OS function
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/irq.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
struct ciabase {
volatile struct CIA *cia;
unsigned char icr_mask, icr_data;
unsigned short int_mask;
int handler_irq, cia_irq, server_irq;
char *name;
} ciaa_base = {
.cia = &ciaa,
.int_mask = IF_PORTS,
.handler_irq = IRQ_AMIGA_PORTS,
.cia_irq = IRQ_AMIGA_CIAA,
.name = "CIAA"
}, ciab_base = {
.cia = &ciab,
.int_mask = IF_EXTER,
.handler_irq = IRQ_AMIGA_EXTER,
.cia_irq = IRQ_AMIGA_CIAB,
.name = "CIAB"
};
/*
* Cause or clear CIA interrupts, return old interrupt status.
*/
unsigned char cia_set_irq(struct ciabase *base, unsigned char mask)
{
unsigned char old;
old = (base->icr_data |= base->cia->icr);
if (mask & CIA_ICR_SETCLR)
base->icr_data |= mask;
else
base->icr_data &= ~mask;
if (base->icr_data & base->icr_mask)
amiga_custom.intreq = IF_SETCLR | base->int_mask;
return old & base->icr_mask;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 77 | 96.25% | 1 | 33.33% |
Linus Torvalds | 2 | 2.50% | 1 | 33.33% |
Al Viro | 1 | 1.25% | 1 | 33.33% |
Total | 80 | 100.00% | 3 | 100.00% |
/*
* Enable or disable CIA interrupts, return old interrupt mask,
*/
unsigned char cia_able_irq(struct ciabase *base, unsigned char mask)
{
unsigned char old;
old = base->icr_mask;
base->icr_data |= base->cia->icr;
base->cia->icr = mask;
if (mask & CIA_ICR_SETCLR)
base->icr_mask |= mask;
else
base->icr_mask &= ~mask;
base->icr_mask &= CIA_ICR_ALL;
if (base->icr_data & base->icr_mask)
amiga_custom.intreq = IF_SETCLR | base->int_mask;
return old;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 89 | 96.74% | 1 | 33.33% |
Linus Torvalds | 2 | 2.17% | 1 | 33.33% |
Al Viro | 1 | 1.09% | 1 | 33.33% |
Total | 92 | 100.00% | 3 | 100.00% |
static irqreturn_t cia_handler(int irq, void *dev_id)
{
struct ciabase *base = dev_id;
int mach_irq;
unsigned char ints;
mach_irq = base->cia_irq;
ints = cia_set_irq(base, CIA_ICR_ALL);
amiga_custom.intreq = base->int_mask;
for (; ints; mach_irq++, ints >>= 1) {
if (ints & 1)
generic_handle_irq(mach_irq);
}
return IRQ_HANDLED;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 67 | 85.90% | 1 | 20.00% |
Geert Uytterhoeven | 5 | 6.41% | 2 | 40.00% |
Roman Zippel | 5 | 6.41% | 1 | 20.00% |
Al Viro | 1 | 1.28% | 1 | 20.00% |
Total | 78 | 100.00% | 5 | 100.00% |
static void cia_irq_enable(struct irq_data *data)
{
unsigned int irq = data->irq;
unsigned char mask;
if (irq >= IRQ_AMIGA_CIAB) {
mask = 1 << (irq - IRQ_AMIGA_CIAB);
cia_set_irq(&ciab_base, mask);
cia_able_irq(&ciab_base, CIA_ICR_SETCLR | mask);
} else {
mask = 1 << (irq - IRQ_AMIGA_CIAA);
cia_set_irq(&ciaa_base, mask);
cia_able_irq(&ciaa_base, CIA_ICR_SETCLR | mask);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Roman Zippel | 59 | 65.56% | 1 | 25.00% |
Linus Torvalds (pre-git) | 19 | 21.11% | 2 | 50.00% |
Geert Uytterhoeven | 12 | 13.33% | 1 | 25.00% |
Total | 90 | 100.00% | 4 | 100.00% |
static void cia_irq_disable(struct irq_data *data)
{
unsigned int irq = data->irq;
if (irq >= IRQ_AMIGA_CIAB)
cia_able_irq(&ciab_base, 1 << (irq - IRQ_AMIGA_CIAB));
else
cia_able_irq(&ciaa_base, 1 << (irq - IRQ_AMIGA_CIAA));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Roman Zippel | 38 | 70.37% | 1 | 33.33% |
Geert Uytterhoeven | 12 | 22.22% | 1 | 33.33% |
Linus Torvalds (pre-git) | 4 | 7.41% | 1 | 33.33% |
Total | 54 | 100.00% | 3 | 100.00% |
static struct irq_chip cia_irq_chip = {
.name = "cia",
.irq_enable = cia_irq_enable,
.irq_disable = cia_irq_disable,
};
/*
* Override auto irq 2 & 6 and use them as general chain
* for external interrupts, we link the CIA interrupt sources
* into this chain.
*/
static void auto_irq_enable(struct irq_data *data)
{
switch (data->irq) {
case IRQ_AUTO_2:
amiga_custom.intena = IF_SETCLR | IF_PORTS;
break;
case IRQ_AUTO_6:
amiga_custom.intena = IF_SETCLR | IF_EXTER;
break;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Roman Zippel | 28 | 65.12% | 1 | 25.00% |
Linus Torvalds (pre-git) | 7 | 16.28% | 1 | 25.00% |
Geert Uytterhoeven | 7 | 16.28% | 1 | 25.00% |
Al Viro | 1 | 2.33% | 1 | 25.00% |
Total | 43 | 100.00% | 4 | 100.00% |
static void auto_irq_disable(struct irq_data *data)
{
switch (data->irq) {
case IRQ_AUTO_2:
amiga_custom.intena = IF_PORTS;
break;
case IRQ_AUTO_6:
amiga_custom.intena = IF_EXTER;
break;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Roman Zippel | 32 | 82.05% | 1 | 50.00% |
Geert Uytterhoeven | 7 | 17.95% | 1 | 50.00% |
Total | 39 | 100.00% | 2 | 100.00% |
static struct irq_chip auto_irq_chip = {
.name = "auto",
.irq_enable = auto_irq_enable,
.irq_disable = auto_irq_disable,
};
void __init cia_init_IRQ(struct ciabase *base)
{
m68k_setup_irq_controller(&cia_irq_chip, handle_simple_irq,
base->cia_irq, CIA_IRQS);
/* clear any pending interrupt and turn off all interrupts */
cia_set_irq(base, CIA_ICR_ALL);
cia_able_irq(base, CIA_ICR_ALL);
/* override auto int and install CIA handler */
m68k_setup_irq_controller(&auto_irq_chip, handle_simple_irq,
base->handler_irq, 1);
m68k_irq_startup_irq(base->handler_irq);
if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED,
base->name, base))
pr_err("Couldn't register %s interrupt\n", base->name);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Roman Zippel | 41 | 45.56% | 1 | 12.50% |
Linus Torvalds (pre-git) | 27 | 30.00% | 1 | 12.50% |
Geert Uytterhoeven | 20 | 22.22% | 4 | 50.00% |
Thomas Gleixner | 1 | 1.11% | 1 | 12.50% |
Andrew Morton | 1 | 1.11% | 1 | 12.50% |
Total | 90 | 100.00% | 8 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 372 | 50.20% | 3 | 16.67% |
Roman Zippel | 241 | 32.52% | 1 | 5.56% |
Geert Uytterhoeven | 108 | 14.57% | 8 | 44.44% |
Linus Torvalds | 11 | 1.48% | 2 | 11.11% |
Thomas Gleixner | 4 | 0.54% | 2 | 11.11% |
Al Viro | 4 | 0.54% | 1 | 5.56% |
Andrew Morton | 1 | 0.13% | 1 | 5.56% |
Total | 741 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.