Release 4.11 arch/arm/mach-netx/generic.c
/*
* arch/arm/mach-netx/generic.c
*
* Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/device.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/irqchip/arm-vic.h>
#include <linux/reboot.h>
#include <mach/hardware.h>
#include <asm/mach/map.h>
#include <mach/netx-regs.h>
#include <asm/mach/irq.h>
static struct map_desc netx_io_desc[] __initdata = {
{
.virtual = NETX_IO_VIRT,
.pfn = __phys_to_pfn(NETX_IO_PHYS),
.length = NETX_IO_SIZE,
.type = MT_DEVICE
}
};
void __init netx_map_io(void)
{
iotable_init(netx_io_desc, ARRAY_SIZE(netx_io_desc));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
static struct resource netx_rtc_resources[] = {
[0] = {
.start = 0x00101200,
.end = 0x00101220,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device netx_rtc_device = {
.name = "netx-rtc",
.id = 0,
.num_resources = ARRAY_SIZE(netx_rtc_resources),
.resource = netx_rtc_resources,
};
static struct platform_device *devices[] __initdata = {
&netx_rtc_device,
};
#if 0
#define DEBUG_IRQ(fmt...) printk(fmt)
#else
#define DEBUG_IRQ(fmt...) while (0) {}
#endif
static void netx_hif_demux_handler(struct irq_desc *desc)
{
unsigned int irq = NETX_IRQ_HIF_CHAINED(0);
unsigned int stat;
stat = ((readl(NETX_DPMAS_INT_EN) &
readl(NETX_DPMAS_INT_STAT)) >> 24) & 0x1f;
while (stat) {
if (stat & 1) {
DEBUG_IRQ("handling irq %d\n", irq);
generic_handle_irq(irq);
}
irq++;
stat >>= 1;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 75 | 97.40% | 1 | 33.33% |
Russell King | 1 | 1.30% | 1 | 33.33% |
Dmitry Baryshkov | 1 | 1.30% | 1 | 33.33% |
Total | 77 | 100.00% | 3 | 100.00% |
static int
netx_hif_irq_type(struct irq_data *d, unsigned int type)
{
unsigned int val, irq;
val = readl(NETX_DPMAS_IF_CONF1);
irq = d->irq - NETX_IRQ_HIF_CHAINED(0);
if (type & IRQ_TYPE_EDGE_RISING) {
DEBUG_IRQ("rising edges\n");
val |= (1 << 26) << irq;
}
if (type & IRQ_TYPE_EDGE_FALLING) {
DEBUG_IRQ("falling edges\n");
val &= ~((1 << 26) << irq);
}
if (type & IRQ_TYPE_LEVEL_LOW) {
DEBUG_IRQ("low level\n");
val &= ~((1 << 26) << irq);
}
if (type & IRQ_TYPE_LEVEL_HIGH) {
DEBUG_IRQ("high level\n");
val |= (1 << 26) << irq;
}
writel(val, NETX_DPMAS_IF_CONF1);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 136 | 92.52% | 1 | 33.33% |
Lennert Buytenhek | 7 | 4.76% | 1 | 33.33% |
Dmitry Baryshkov | 4 | 2.72% | 1 | 33.33% |
Total | 147 | 100.00% | 3 | 100.00% |
static void
netx_hif_ack_irq(struct irq_data *d)
{
unsigned int val, irq;
irq = d->irq - NETX_IRQ_HIF_CHAINED(0);
writel((1 << 24) << irq, NETX_DPMAS_INT_STAT);
val = readl(NETX_DPMAS_INT_EN);
val &= ~((1 << 24) << irq);
writel(val, NETX_DPMAS_INT_EN);
DEBUG_IRQ("%s: irq %d\n", __func__, d->irq);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 68 | 86.08% | 1 | 33.33% |
Lennert Buytenhek | 10 | 12.66% | 1 | 33.33% |
Harvey Harrison | 1 | 1.27% | 1 | 33.33% |
Total | 79 | 100.00% | 3 | 100.00% |
static void
netx_hif_mask_irq(struct irq_data *d)
{
unsigned int val, irq;
irq = d->irq - NETX_IRQ_HIF_CHAINED(0);
val = readl(NETX_DPMAS_INT_EN);
val &= ~((1 << 24) << irq);
writel(val, NETX_DPMAS_INT_EN);
DEBUG_IRQ("%s: irq %d\n", __func__, d->irq);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 55 | 83.33% | 1 | 33.33% |
Lennert Buytenhek | 10 | 15.15% | 1 | 33.33% |
Harvey Harrison | 1 | 1.52% | 1 | 33.33% |
Total | 66 | 100.00% | 3 | 100.00% |
static void
netx_hif_unmask_irq(struct irq_data *d)
{
unsigned int val, irq;
irq = d->irq - NETX_IRQ_HIF_CHAINED(0);
val = readl(NETX_DPMAS_INT_EN);
val |= (1 << 24) << irq;
writel(val, NETX_DPMAS_INT_EN);
DEBUG_IRQ("%s: irq %d\n", __func__, d->irq);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 52 | 82.54% | 1 | 33.33% |
Lennert Buytenhek | 10 | 15.87% | 1 | 33.33% |
Harvey Harrison | 1 | 1.59% | 1 | 33.33% |
Total | 63 | 100.00% | 3 | 100.00% |
static struct irq_chip netx_hif_chip = {
.irq_ack = netx_hif_ack_irq,
.irq_mask = netx_hif_mask_irq,
.irq_unmask = netx_hif_unmask_irq,
.irq_set_type = netx_hif_irq_type,
};
void __init netx_init_irq(void)
{
int irq;
vic_init(io_p2v(NETX_PA_VIC), NETX_IRQ_VIC_START, ~0, 0);
for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) {
irq_set_chip_and_handler(irq, &netx_hif_chip,
handle_level_irq);
irq_clear_status_flags(irq, IRQ_NOREQUEST);
}
writel(NETX_DPMAS_INT_EN_GLB_EN, NETX_DPMAS_INT_EN);
irq_set_chained_handler(NETX_IRQ_HIF, netx_hif_demux_handler);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 67 | 89.33% | 1 | 14.29% |
Ben Dooks | 2 | 2.67% | 1 | 14.29% |
Thomas Gleixner | 2 | 2.67% | 2 | 28.57% |
Rob Herring | 2 | 2.67% | 1 | 14.29% |
Russell King | 1 | 1.33% | 1 | 14.29% |
Linus Walleij | 1 | 1.33% | 1 | 14.29% |
Total | 75 | 100.00% | 7 | 100.00% |
static int __init netx_init(void)
{
return platform_add_devices(devices, ARRAY_SIZE(devices));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
subsys_initcall(netx_init);
void netx_restart(enum reboot_mode mode, const char *cmd)
{
writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
NETX_SYSTEM_RES_CR);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 21 | 91.30% | 1 | 50.00% |
Robin Holt | 2 | 8.70% | 1 | 50.00% |
Total | 23 | 100.00% | 2 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sascha Hauer | 676 | 88.25% | 1 | 6.25% |
Lennert Buytenhek | 41 | 5.35% | 1 | 6.25% |
Russell King | 26 | 3.39% | 4 | 25.00% |
Rob Herring | 5 | 0.65% | 2 | 12.50% |
Dmitry Baryshkov | 5 | 0.65% | 2 | 12.50% |
Robin Holt | 5 | 0.65% | 1 | 6.25% |
Harvey Harrison | 3 | 0.39% | 1 | 6.25% |
Ben Dooks | 2 | 0.26% | 1 | 6.25% |
Thomas Gleixner | 2 | 0.26% | 2 | 12.50% |
Linus Walleij | 1 | 0.13% | 1 | 6.25% |
Total | 766 | 100.00% | 16 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.