mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
adm8668: merge 3.3 fixes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31497 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -20,11 +20,20 @@
|
||||
#include <asm/irq.h>
|
||||
#include <adm8668.h>
|
||||
|
||||
static void adm8668_irq_cascade(void)
|
||||
{
|
||||
int i;
|
||||
unsigned long intsrc;
|
||||
|
||||
void enable_adm8668_irq(unsigned int irq);
|
||||
void disable_adm8668_irq(unsigned int irq);
|
||||
void adm8668_irq_cascade(void);
|
||||
intsrc = ADM8668_INTC_REG(IRQ_STATUS_REG) & IRQ_MASK;
|
||||
for (i = 0; intsrc; intsrc >>= 1, i++)
|
||||
if (intsrc & 0x1)
|
||||
do_IRQ(i);
|
||||
}
|
||||
|
||||
/*
|
||||
* System irq dispatch
|
||||
*/
|
||||
void plat_irq_dispatch(void)
|
||||
{
|
||||
unsigned int pending;
|
||||
@@ -38,64 +47,38 @@ void plat_irq_dispatch(void)
|
||||
adm8668_irq_cascade();
|
||||
}
|
||||
|
||||
/*
|
||||
* System irq dispatch
|
||||
*/
|
||||
void adm8668_irq_cascade()
|
||||
{
|
||||
int i;
|
||||
unsigned long intsrc;
|
||||
|
||||
intsrc = ADM8668_INTC_REG(IRQ_STATUS_REG) & IRQ_MASK;
|
||||
for (i = 0; intsrc; intsrc >>= 1, i++)
|
||||
if (intsrc & 0x1)
|
||||
do_IRQ(i);
|
||||
}
|
||||
|
||||
/*
|
||||
* irq enable
|
||||
*/
|
||||
static __inline void _irq_enable(int irql)
|
||||
{
|
||||
ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irql);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* irq disable
|
||||
*/
|
||||
static __inline void _irq_disable(int irql)
|
||||
{
|
||||
ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irql);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* enable 8668 irq
|
||||
*/
|
||||
void enable_adm8668_irq(unsigned int irq)
|
||||
static void enable_adm8668_irq(struct irq_data *d)
|
||||
{
|
||||
int irq = d->irq;
|
||||
|
||||
if ((irq < 0) || (irq > NR_IRQS))
|
||||
return;
|
||||
|
||||
_irq_enable(irq);
|
||||
ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irq);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* disable 8668 irq
|
||||
*/
|
||||
void disable_adm8668_irq(unsigned int irq)
|
||||
static void disable_adm8668_irq(struct irq_data *d)
|
||||
{
|
||||
int irq = d->irq;
|
||||
|
||||
if ((irq < 0) || (irq > NR_IRQS))
|
||||
return;
|
||||
|
||||
_irq_disable(irq);
|
||||
ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq);
|
||||
}
|
||||
|
||||
static inline void ack_adm8668_irq(unsigned int irq_nr)
|
||||
static void ack_adm8668_irq(struct irq_data *d)
|
||||
{
|
||||
ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq_nr);
|
||||
int irq = d->irq;
|
||||
|
||||
ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -104,20 +87,20 @@ static inline void ack_adm8668_irq(unsigned int irq_nr)
|
||||
|
||||
static struct irq_chip adm8668_irq_type = {
|
||||
.name = "adm8668",
|
||||
.ack = ack_adm8668_irq,
|
||||
.mask = disable_adm8668_irq,
|
||||
.unmask = enable_adm8668_irq
|
||||
.irq_ack = ack_adm8668_irq,
|
||||
.irq_mask = disable_adm8668_irq,
|
||||
.irq_unmask = enable_adm8668_irq
|
||||
};
|
||||
|
||||
/*
|
||||
* irq init
|
||||
*/
|
||||
void __init init_adm8668_irqs(void)
|
||||
static void __init init_adm8668_irqs(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= INT_LVL_MAX; i++)
|
||||
set_irq_chip_and_handler(i, &adm8668_irq_type,
|
||||
irq_set_chip_and_handler(i, &adm8668_irq_type,
|
||||
handle_level_irq);
|
||||
|
||||
/* hw0 is where our interrupts are uh.. interrupted at. */
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define __NET_TULIP_H__
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mii.h>
|
||||
@@ -25,10 +26,10 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
/* undefine, or define to various debugging levels (>4 == obscene levels) */
|
||||
#define TULIP_DEBUG 1
|
||||
|
||||
@@ -133,7 +133,7 @@ tulip_open(struct net_device *dev)
|
||||
|
||||
tulip_init_ring (dev);
|
||||
|
||||
retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev);
|
||||
retval = request_irq(dev->irq, tulip_interrupt, 0, dev->name, dev);
|
||||
if (retval)
|
||||
goto free_ring;
|
||||
|
||||
@@ -469,7 +469,7 @@ static const struct net_device_ops tulip_netdev_ops = {
|
||||
.ndo_tx_timeout = tulip_tx_timeout,
|
||||
.ndo_stop = tulip_close,
|
||||
.ndo_get_stats = tulip_get_stats,
|
||||
.ndo_set_multicast_list = set_rx_mode,
|
||||
.ndo_set_rx_mode = set_rx_mode,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
@@ -509,6 +509,7 @@ static int __devinit adm8668net_probe(struct platform_device *pdev)
|
||||
tp->dev = dev;
|
||||
tp->base_addr = ioaddr;
|
||||
tp->csr0 = csr0;
|
||||
tp->pdev = pdev;
|
||||
tp->rx_ring = dma_alloc_coherent(&pdev->dev,
|
||||
sizeof(struct tulip_rx_desc) * RX_RING_SIZE +
|
||||
sizeof(struct tulip_tx_desc) * TX_RING_SIZE,
|
||||
|
||||
Reference in New Issue
Block a user