aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-28 10:41:43 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-04-28 10:41:43 +0000
commit1a0ef042317fd83f0fc8cc9ffd434a3419bc5301 (patch)
treeedb4e4242e76737e03680210625529749aa624bf
parent87ae19eaa3c7149c42c85ad9c04f2c737b54d991 (diff)
downloadupstream-1a0ef042317fd83f0fc8cc9ffd434a3419bc5301.tar.gz
upstream-1a0ef042317fd83f0fc8cc9ffd434a3419bc5301.tar.bz2
upstream-1a0ef042317fd83f0fc8cc9ffd434a3419bc5301.zip
adm8668: merge 3.3 fixes
SVN-Revision: 31497
-rw-r--r--target/linux/adm8668/files/arch/mips/adm8668/irq.c71
-rw-r--r--target/linux/adm8668/files/arch/mips/adm8668/net.h5
-rw-r--r--target/linux/adm8668/files/arch/mips/adm8668/net_core.c5
-rw-r--r--target/linux/adm8668/files/drivers/mtd/maps/adm8668.c28
-rw-r--r--target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch129
-rw-r--r--target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch51
-rw-r--r--target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch81
7 files changed, 43 insertions, 327 deletions
diff --git a/target/linux/adm8668/files/arch/mips/adm8668/irq.c b/target/linux/adm8668/files/arch/mips/adm8668/irq.c
index aac2ff4e0b..e048c15c8a 100644
--- a/target/linux/adm8668/files/arch/mips/adm8668/irq.c
+++ b/target/linux/adm8668/files/arch/mips/adm8668/irq.c
@@ -20,28 +20,7 @@
#include <asm/irq.h>
#include <adm8668.h>
-
-void enable_adm8668_irq(unsigned int irq);
-void disable_adm8668_irq(unsigned int irq);
-void adm8668_irq_cascade(void);
-
-void plat_irq_dispatch(void)
-{
- unsigned int pending;
-
- pending = read_c0_cause() & read_c0_status() & ST0_IM;
-
- /* timer interrupt, that we renumbered */
- if (pending & STATUSF_IP7)
- do_IRQ(MIPS_CPU_IRQ_BASE + 7);
- if (pending & STATUSF_IP2)
- adm8668_irq_cascade();
-}
-
-/*
- * System irq dispatch
- */
-void adm8668_irq_cascade()
+static void adm8668_irq_cascade(void)
{
int i;
unsigned long intsrc;
@@ -53,49 +32,53 @@ void adm8668_irq_cascade()
}
/*
- * irq enable
+ * System irq dispatch
*/
-static __inline void _irq_enable(int irql)
+void plat_irq_dispatch(void)
{
- ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irql);
-}
+ unsigned int pending;
+ pending = read_c0_cause() & read_c0_status() & ST0_IM;
-/*
- * irq disable
- */
-static __inline void _irq_disable(int irql)
-{
- ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irql);
+ /* timer interrupt, that we renumbered */
+ if (pending & STATUSF_IP7)
+ do_IRQ(MIPS_CPU_IRQ_BASE + 7);
+ if (pending & STATUSF_IP2)
+ adm8668_irq_cascade();
}
-
/*
* 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. */
diff --git a/target/linux/adm8668/files/arch/mips/adm8668/net.h b/target/linux/adm8668/files/arch/mips/adm8668/net.h
index 2705a35833..c7aef8cf6e 100644
--- a/target/linux/adm8668/files/arch/mips/adm8668/net.h
+++ b/target/linux/adm8668/files/arch/mips/adm8668/net.h
@@ -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
diff --git a/target/linux/adm8668/files/arch/mips/adm8668/net_core.c b/target/linux/adm8668/files/arch/mips/adm8668/net_core.c
index 85a5adb7d8..3348c224b5 100644
--- a/target/linux/adm8668/files/arch/mips/adm8668/net_core.c
+++ b/target/linux/adm8668/files/arch/mips/adm8668/net_core.c
@@ -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,
diff --git a/target/linux/adm8668/files/drivers/mtd/maps/adm8668.c b/target/linux/adm8668/files/drivers/mtd/maps/adm8668.c
index 8d0ab690f2..e360a0d78c 100644
--- a/target/linux/adm8668/files/drivers/mtd/maps/adm8668.c
+++ b/target/linux/adm8668/files/drivers/mtd/maps/adm8668.c
@@ -47,9 +47,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/slab.h>
-#ifdef CONFIG_MTD_PARTITIONS
#include <linux/mtd/partitions.h>
-#endif
#include <linux/crc32.h>
#include <linux/magic.h>
#include <asm/io.h>
@@ -94,8 +92,6 @@ struct map_info adm8668_map = {
bankwidth: BANKWIDTH,
};
-#ifdef CONFIG_MTD_PARTITIONS
-
/*
* Copied from mtdblock.c
*
@@ -238,7 +234,12 @@ init_mtd_partitions(struct mtd_info *mtd, size_t size)
return NR_PARTS;
if (be32_to_cpu(uhdr.ih_size) != (linux_len - sizeof(uhdr))) {
- unsigned char *block, *data = (unsigned char *)(WINDOW_ADDR | (adm8668_parts[PART_LINUX].offset + sizeof(struct uboot_header)) | 0xA0000000);
+ unsigned char *block, *data;
+ unsigned int offset;
+
+ offset = adm8668_parts[PART_LINUX].offset +
+ sizeof(struct uboot_header);
+ data = (unsigned char *)(WINDOW_ADDR | 0xA0000000 | offset);
printk(KERN_NOTICE "Updating U-boot image:\n");
printk(KERN_NOTICE " old: [size: %8d crc32: 0x%08x]\n",
@@ -279,16 +280,11 @@ init_mtd_partitions(struct mtd_info *mtd, size_t size)
return NR_PARTS;
}
-#endif
-
-
int __init init_adm8668_map(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
int nr_parts, ret;
-#endif
- adm8668_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+ adm8668_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
if (!adm8668_map.virt) {
printk(KERN_ERR "Failed to ioremap\n");
@@ -304,14 +300,12 @@ int __init init_adm8668_map(void)
adm8668_mtd->owner = THIS_MODULE;
-#ifdef CONFIG_MTD_PARTITIONS
nr_parts = init_mtd_partitions(adm8668_mtd, adm8668_mtd->size);
- ret = add_mtd_partitions(adm8668_mtd, adm8668_parts, nr_parts);
+ ret = mtd_device_register(adm8668_mtd, adm8668_parts, nr_parts);
if (ret) {
- printk(KERN_ERR "Flash: add_mtd_partitions failed\n");
+ printk(KERN_ERR "Flash: mtd_device_register failed\n");
goto fail;
}
-#endif
return 0;
@@ -326,9 +320,7 @@ int __init init_adm8668_map(void)
void __exit cleanup_adm8668_map(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
- del_mtd_partitions(adm8668_mtd);
-#endif
+ mtd_device_unregister(adm8668_mtd);
map_destroy(adm8668_mtd);
iounmap((void *) adm8668_map.virt);
adm8668_map.virt = 0;
diff --git a/target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch b/target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch
deleted file mode 100644
index 79f5596b26..0000000000
--- a/target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch
+++ /dev/null
@@ -1,129 +0,0 @@
---- a/arch/mips/adm8668/irq.c
-+++ b/arch/mips/adm8668/irq.c
-@@ -20,28 +20,7 @@
- #include <asm/irq.h>
- #include <adm8668.h>
-
--
--void enable_adm8668_irq(unsigned int irq);
--void disable_adm8668_irq(unsigned int irq);
--void adm8668_irq_cascade(void);
--
--void plat_irq_dispatch(void)
--{
-- unsigned int pending;
--
-- pending = read_c0_cause() & read_c0_status() & ST0_IM;
--
-- /* timer interrupt, that we renumbered */
-- if (pending & STATUSF_IP7)
-- do_IRQ(MIPS_CPU_IRQ_BASE + 7);
-- if (pending & STATUSF_IP2)
-- adm8668_irq_cascade();
--}
--
--/*
-- * System irq dispatch
-- */
--void adm8668_irq_cascade()
-+static void adm8668_irq_cascade(void)
- {
- int i;
- unsigned long intsrc;
-@@ -53,49 +32,53 @@ void adm8668_irq_cascade()
- }
-
- /*
-- * irq enable
-+ * System irq dispatch
- */
--static __inline void _irq_enable(int irql)
-+void plat_irq_dispatch(void)
- {
-- ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irql);
--}
-+ unsigned int pending;
-
-+ pending = read_c0_cause() & read_c0_status() & ST0_IM;
-
--/*
-- * irq disable
-- */
--static __inline void _irq_disable(int irql)
--{
-- ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irql);
-+ /* timer interrupt, that we renumbered */
-+ if (pending & STATUSF_IP7)
-+ do_IRQ(MIPS_CPU_IRQ_BASE + 7);
-+ if (pending & STATUSF_IP2)
-+ adm8668_irq_cascade();
- }
-
--
- /*
- * 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(unsig
-
- 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. */
diff --git a/target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch b/target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch
deleted file mode 100644
index 4768b37dd2..0000000000
--- a/target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/arch/mips/adm8668/net_core.c
-+++ b/arch/mips/adm8668/net_core.c
-@@ -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
- .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(st
- 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,
---- a/arch/mips/adm8668/net.h
-+++ b/arch/mips/adm8668/net.h
-@@ -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
diff --git a/target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch b/target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch
deleted file mode 100644
index 6d820c9ce4..0000000000
--- a/target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch
+++ /dev/null
@@ -1,81 +0,0 @@
---- a/drivers/mtd/maps/adm8668.c
-+++ b/drivers/mtd/maps/adm8668.c
-@@ -47,9 +47,7 @@
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/map.h>
- #include <linux/slab.h>
--#ifdef CONFIG_MTD_PARTITIONS
- #include <linux/mtd/partitions.h>
--#endif
- #include <linux/crc32.h>
- #include <linux/magic.h>
- #include <asm/io.h>
-@@ -94,8 +92,6 @@ struct map_info adm8668_map = {
- bankwidth: BANKWIDTH,
- };
-
--#ifdef CONFIG_MTD_PARTITIONS
--
- /*
- * Copied from mtdblock.c
- *
-@@ -238,7 +234,12 @@ init_mtd_partitions(struct mtd_info *mtd
- return NR_PARTS;
-
- if (be32_to_cpu(uhdr.ih_size) != (linux_len - sizeof(uhdr))) {
-- unsigned char *block, *data = (unsigned char *)(WINDOW_ADDR | (adm8668_parts[PART_LINUX].offset + sizeof(struct uboot_header)) | 0xA0000000);
-+ unsigned char *block, *data;
-+ unsigned int offset;
-+
-+ offset = adm8668_parts[PART_LINUX].offset +
-+ sizeof(struct uboot_header);
-+ data = (unsigned char *)(WINDOW_ADDR | 0xA0000000 | offset);
-
- printk(KERN_NOTICE "Updating U-boot image:\n");
- printk(KERN_NOTICE " old: [size: %8d crc32: 0x%08x]\n",
-@@ -279,16 +280,11 @@ init_mtd_partitions(struct mtd_info *mtd
- return NR_PARTS;
- }
-
--#endif
--
--
- int __init init_adm8668_map(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- int nr_parts, ret;
--#endif
-
-- adm8668_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
-+ adm8668_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
-
- if (!adm8668_map.virt) {
- printk(KERN_ERR "Failed to ioremap\n");
-@@ -304,14 +300,12 @@ int __init init_adm8668_map(void)
-
- adm8668_mtd->owner = THIS_MODULE;
-
--#ifdef CONFIG_MTD_PARTITIONS
- nr_parts = init_mtd_partitions(adm8668_mtd, adm8668_mtd->size);
-- ret = add_mtd_partitions(adm8668_mtd, adm8668_parts, nr_parts);
-+ ret = mtd_device_register(adm8668_mtd, adm8668_parts, nr_parts);
- if (ret) {
-- printk(KERN_ERR "Flash: add_mtd_partitions failed\n");
-+ printk(KERN_ERR "Flash: mtd_device_register failed\n");
- goto fail;
- }
--#endif
-
- return 0;
-
-@@ -326,9 +320,7 @@ int __init init_adm8668_map(void)
-
- void __exit cleanup_adm8668_map(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
-- del_mtd_partitions(adm8668_mtd);
--#endif
-+ mtd_device_unregister(adm8668_mtd);
- map_destroy(adm8668_mtd);
- iounmap((void *) adm8668_map.virt);
- adm8668_map.virt = 0;