From: Imre Kaloz Date: Sat, 26 May 2007 15:54:22 +0000 (+0000) Subject: bcm47xx compile fix for .21, thanks to noz X-Git-Tag: reboot~29168 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3237230249938eff87bc40954b754c89af0f0a3e;p=oweals%2Fopenwrt.git bcm47xx compile fix for .21, thanks to noz SVN-Revision: 7337 --- diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c index 2441ce9dda..7866b9f798 100644 --- a/package/broadcom-diag/src/diag.c +++ b/package/broadcom-diag/src/diag.c @@ -675,8 +675,14 @@ static void unregister_buttons(struct button_t *b) gpio_set_irqenable(0, button_handler); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +static void hotplug_button(struct work_struct *work) +{ + struct event_t *event = container_of(work, struct event_t, wq); +#else static void hotplug_button(struct event_t *event) { +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) call_usermodehelper (event->argv[0], event->argv, event->envp, 1); #else @@ -724,7 +730,11 @@ static irqreturn_t button_handler(int irq, void *dev_id, struct pt_regs *regs) scratch += sprintf (scratch, "SEEN=%ld", (jiffies - b->seen)/HZ) + 1; event->envp[i] = 0; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + INIT_WORK(&event->wq, (void *)(void *)hotplug_button); +#else INIT_WORK(&event->wq, (void *)(void *)hotplug_button, (void *)event); +#endif schedule_work(&event->wq); } diff --git a/package/broadcom-diag/src/diag.h b/package/broadcom-diag/src/diag.h index dcc122ad2b..9b6dc36336 100644 --- a/package/broadcom-diag/src/diag.h +++ b/package/broadcom-diag/src/diag.h @@ -88,7 +88,11 @@ static struct platform_t platform; static void register_buttons(struct button_t *b); static void unregister_buttons(struct button_t *b); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +static void hotplug_button(struct work_struct *work); +#else static void hotplug_button(struct event_t *event); +#endif static irqreturn_t button_handler(int irq, void *dev_id, struct pt_regs *regs); /* leds */ diff --git a/target/linux/brcm47xx-2.6/patches/100-board_support.patch b/target/linux/brcm47xx-2.6/patches/100-board_support.patch index 4d06dcdafe..d80a4fbc8b 100644 --- a/target/linux/brcm47xx-2.6/patches/100-board_support.patch +++ b/target/linux/brcm47xx-2.6/patches/100-board_support.patch @@ -12,7 +12,7 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig mainmenu "Linux/MIPS Kernel Configuration" menu "Machine selection" -@@ -222,6 +226,23 @@ +@@ -240,6 +240,23 @@ Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and Olivetti M700-10 workstations. @@ -39,7 +39,7 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c --- linux.old/arch/mips/kernel/cpu-probe.c 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/arch/mips/kernel/cpu-probe.c 2007-01-25 23:34:01.000000000 +0100 -@@ -723,6 +723,28 @@ +@@ -711,6 +711,28 @@ } @@ -68,7 +68,7 @@ diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu- __init void cpu_probe(void) { struct cpuinfo_mips *c = ¤t_cpu_data; -@@ -745,6 +767,9 @@ +@@ -733,6 +755,9 @@ case PRID_COMP_SIBYTE: cpu_probe_sibyte(c); break; @@ -93,7 +93,7 @@ diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile --- linux.old/arch/mips/Makefile 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/arch/mips/Makefile 2007-01-25 23:34:01.000000000 +0100 -@@ -571,6 +571,18 @@ +@@ -576,6 +576,18 @@ load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000 # @@ -109,13 +109,13 @@ diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile +core-$(CONFIG_CFE) += arch/mips/cfe/ + +# - # SNI RM200 PCI + # SNI RM # - core-$(CONFIG_SNI_RM200_PCI) += arch/mips/sni/ + core-$(CONFIG_SNI_RM) += arch/mips/sni/ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c --- linux.old/arch/mips/mm/tlbex.c 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/arch/mips/mm/tlbex.c 2007-01-25 23:34:01.000000000 +0100 -@@ -880,6 +880,8 @@ +@@ -892,6 +892,8 @@ case CPU_4KSC: case CPU_20KC: case CPU_25KF: @@ -139,15 +139,15 @@ diff -urN linux.old/drivers/Kconfig linux.dev/drivers/Kconfig diff -urN linux.old/drivers/Makefile linux.dev/drivers/Makefile --- linux.old/drivers/Makefile 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/drivers/Makefile 2007-01-25 23:34:01.000000000 +0100 -@@ -77,3 +77,4 @@ - obj-$(CONFIG_SUPERH) += sh/ - obj-$(CONFIG_GENERIC_TIME) += clocksource/ +@@ -81,3 +81,4 @@ obj-$(CONFIG_DMA_ENGINE) += dma/ + obj-$(CONFIG_HID) += hid/ + obj-$(CONFIG_PPC_PS3) += ps3/ +obj-$(CONFIG_SSB) += ssb/ diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h --- linux.old/include/asm-mips/bootinfo.h 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/include/asm-mips/bootinfo.h 2007-01-25 23:34:01.000000000 +0100 -@@ -212,6 +212,12 @@ +@@ -213,6 +213,12 @@ #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ @@ -191,7 +191,7 @@ diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h diff -urN linux.old/include/linux/pci_ids.h linux.dev/include/linux/pci_ids.h --- linux.old/include/linux/pci_ids.h 2007-01-26 00:51:33.000000000 +0100 +++ linux.dev/include/linux/pci_ids.h 2007-01-25 23:34:01.000000000 +0100 -@@ -1950,6 +1950,7 @@ +@@ -1981,6 +1981,7 @@ #define PCI_DEVICE_ID_TIGON3_5906M 0x1713 #define PCI_DEVICE_ID_BCM4401 0x4401 #define PCI_DEVICE_ID_BCM4401B0 0x4402 diff --git a/target/linux/brcm47xx-2.6/patches/110-flash_map.patch b/target/linux/brcm47xx-2.6/patches/110-flash_map.patch index bf809e70ac..13f36c2914 100644 --- a/target/linux/brcm47xx-2.6/patches/110-flash_map.patch +++ b/target/linux/brcm47xx-2.6/patches/110-flash_map.patch @@ -1,7 +1,7 @@ diff -urN linux.old/drivers/mtd/maps/Kconfig linux.dev/drivers/mtd/maps/Kconfig --- linux.old/drivers/mtd/maps/Kconfig 2006-12-11 20:32:53.000000000 +0100 +++ linux.dev/drivers/mtd/maps/Kconfig 2007-01-03 02:26:02.000000000 +0100 -@@ -299,6 +299,12 @@ +@@ -326,6 +326,12 @@ Mapping for the Flaga digital module. If you don't have one, ignore this setting. @@ -17,7 +17,7 @@ diff -urN linux.old/drivers/mtd/maps/Kconfig linux.dev/drivers/mtd/maps/Kconfig diff -urN linux.old/drivers/mtd/maps/Makefile linux.dev/drivers/mtd/maps/Makefile --- linux.old/drivers/mtd/maps/Makefile 2006-12-11 20:32:53.000000000 +0100 +++ linux.dev/drivers/mtd/maps/Makefile 2007-01-03 02:26:02.000000000 +0100 -@@ -29,6 +29,7 @@ +@@ -31,6 +31,7 @@ obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o diff --git a/target/linux/brcm47xx-2.6/patches/120-b44_ssb_support.patch b/target/linux/brcm47xx-2.6/patches/120-b44_ssb_support.patch index 44b2c4297d..5b44774f94 100644 --- a/target/linux/brcm47xx-2.6/patches/120-b44_ssb_support.patch +++ b/target/linux/brcm47xx-2.6/patches/120-b44_ssb_support.patch @@ -27,7 +27,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c #include "b44.h" #define DRV_MODULE_NAME "b44" -@@ -87,8 +91,8 @@ +@@ -86,8 +90,8 @@ static char version[] __devinitdata = DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; @@ -38,7 +38,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_MODULE_VERSION); -@@ -96,24 +100,18 @@ +@@ -95,18 +99,11 @@ module_param(b44_debug, int, 0); MODULE_PARM_DESC(b44_debug, "B44 bitmapped debugging message enable value"); @@ -59,15 +59,16 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - static void b44_halt(struct b44 *); static void b44_init_rings(struct b44 *); - static void b44_init_hw(struct b44 *, int); - + +@@ -118,6 +115,7 @@ + static int dma_desc_align_mask; static int dma_desc_sync_size; +static int instance; static const char b44_gstrings[][ETH_GSTRING_LEN] = { #define _B44(x...) # x, -@@ -121,35 +119,24 @@ +@@ -125,35 +123,24 @@ #undef _B44 }; @@ -121,7 +122,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c } static int b44_wait_bit(struct b44 *bp, unsigned long reg, -@@ -177,117 +164,29 @@ +@@ -181,117 +168,29 @@ return 0; } @@ -252,7 +253,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c { u32 val; -@@ -323,14 +222,14 @@ +@@ -327,14 +226,14 @@ bw32(bp, B44_IMASK, bp->imask); } @@ -269,7 +270,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c (reg << MDIO_DATA_RA_SHIFT) | (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT))); err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0); -@@ -339,18 +238,34 @@ +@@ -343,18 +242,34 @@ return err; } @@ -306,7 +307,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c /* miilib interface */ /* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional * due to code existing before miilib use was added to this driver. -@@ -379,6 +294,8 @@ +@@ -383,6 +298,8 @@ u32 val; int err; @@ -315,7 +316,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c err = b44_writephy(bp, MII_BMCR, BMCR_RESET); if (err) return err; -@@ -437,11 +354,27 @@ +@@ -441,11 +358,27 @@ __b44_set_flow_ctrl(bp, pause_enab); } @@ -343,7 +344,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0) goto out; if ((err = b44_writephy(bp, B44_MII_ALEDCTRL, -@@ -537,6 +470,19 @@ +@@ -541,6 +474,19 @@ { u32 bmsr, aux; @@ -363,7 +364,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c if (!b44_readphy(bp, MII_BMSR, &bmsr) && !b44_readphy(bp, B44_MII_AUXCTRL, &aux) && (bmsr != 0xffff)) { -@@ -613,10 +559,10 @@ +@@ -617,10 +563,10 @@ BUG_ON(skb == NULL); @@ -376,7 +377,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c rp->skb = NULL; dev_kfree_skb_irq(skb); } -@@ -652,10 +598,10 @@ +@@ -656,10 +602,10 @@ skb = dev_alloc_skb(RX_PKT_BUF_SZ); if (skb == NULL) return -ENOMEM; @@ -390,8 +391,8 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c /* Hardware bug work-around, the chip is unable to do PCI DMA to/from anything above 1GB :-( */ -@@ -663,18 +609,18 @@ - mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { +@@ -667,18 +613,18 @@ + mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) { /* Sigh... */ if (!dma_mapping_error(mapping)) - pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); @@ -406,14 +407,14 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - PCI_DMA_FROMDEVICE); + DMA_FROM_DEVICE); if (dma_mapping_error(mapping) || - mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { + mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) { if (!dma_mapping_error(mapping)) - pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); + dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE); dev_kfree_skb_any(skb); return -ENOMEM; } -@@ -703,9 +649,9 @@ +@@ -707,9 +653,9 @@ dp->addr = cpu_to_le32((u32) mapping + bp->rx_offset + bp->dma_offset); if (bp->flags & B44_FLAG_RX_RING_HACK) @@ -426,7 +427,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c return RX_PKT_BUF_SZ; } -@@ -732,9 +678,9 @@ +@@ -736,9 +682,9 @@ pci_unmap_addr(src_map, mapping)); if (bp->flags & B44_FLAG_RX_RING_HACK) @@ -439,7 +440,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c ctrl = src_desc->ctrl; if (dest_idx == (B44_RX_RING_SIZE - 1)) -@@ -748,13 +694,13 @@ +@@ -752,13 +698,13 @@ src_map->skb = NULL; if (bp->flags & B44_FLAG_RX_RING_HACK) @@ -450,15 +451,15 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c + dest_idx * sizeof(dest_desc), + DMA_BIDIRECTIONAL); -- pci_dma_sync_single_for_device(bp->pdev, src_desc->addr, -+ dma_sync_single_for_device(&bp->sdev->dev, src_desc->addr, +- pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr), ++ dma_sync_single_for_device(&bp->sdev->dev, le32_to_cpu(src_desc->addr), RX_PKT_BUF_SZ, - PCI_DMA_FROMDEVICE); + DMA_FROM_DEVICE); } static int b44_rx(struct b44 *bp, int budget) -@@ -774,9 +720,9 @@ +@@ -778,9 +724,9 @@ struct rx_header *rh; u16 len; @@ -468,9 +469,9 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - PCI_DMA_FROMDEVICE); + DMA_FROM_DEVICE); rh = (struct rx_header *) skb->data; - len = cpu_to_le16(rh->len); + len = le16_to_cpu(rh->len); if ((len > (RX_PKT_BUF_SZ - bp->rx_offset)) || -@@ -808,11 +754,11 @@ +@@ -812,11 +758,11 @@ skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); if (skb_size < 0) goto drop_it; @@ -486,13 +487,13 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c } else { struct sk_buff *copy_skb; -@@ -980,23 +926,23 @@ +@@ -986,23 +932,23 @@ goto err_out; } - mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); + mapping = dma_map_single(&bp->sdev->dev, skb->data, len, DMA_TO_DEVICE); - if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { + if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { /* Chip can't handle DMA to/from >1GB, use bounce buffer */ if (!dma_mapping_error(mapping)) - pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); @@ -507,7 +508,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - len, PCI_DMA_TODEVICE); + mapping = dma_map_single(&bp->sdev->dev, bounce_skb->data, + len, DMA_TO_DEVICE); - if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { + if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) { if (!dma_mapping_error(mapping)) - pci_unmap_single(bp->pdev, mapping, - len, PCI_DMA_TODEVICE); @@ -516,7 +517,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c dev_kfree_skb_any(bounce_skb); goto err_out; } -@@ -1019,9 +965,9 @@ +@@ -1025,9 +971,9 @@ bp->tx_ring[entry].addr = cpu_to_le32((u32) mapping+bp->dma_offset); if (bp->flags & B44_FLAG_TX_RING_HACK) @@ -529,7 +530,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c entry = NEXT_TX(entry); -@@ -1094,10 +1040,10 @@ +@@ -1100,10 +1046,10 @@ if (rp->skb == NULL) continue; @@ -542,7 +543,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c dev_kfree_skb_any(rp->skb); rp->skb = NULL; } -@@ -1108,10 +1054,10 @@ +@@ -1114,10 +1060,10 @@ if (rp->skb == NULL) continue; @@ -555,7 +556,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c dev_kfree_skb_any(rp->skb); rp->skb = NULL; } -@@ -1133,14 +1079,14 @@ +@@ -1139,14 +1085,14 @@ memset(bp->tx_ring, 0, B44_TX_RING_BYTES); if (bp->flags & B44_FLAG_RX_RING_HACK) @@ -576,7 +577,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c for (i = 0; i < bp->rx_pending; i++) { if (b44_alloc_rx_skb(bp, -1, i) < 0) -@@ -1160,24 +1106,24 @@ +@@ -1166,24 +1112,24 @@ bp->tx_buffers = NULL; if (bp->rx_ring) { if (bp->flags & B44_FLAG_RX_RING_HACK) { @@ -609,7 +610,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c bp->tx_ring, bp->tx_ring_dma); bp->tx_ring = NULL; bp->flags &= ~B44_FLAG_TX_RING_HACK; -@@ -1203,7 +1149,7 @@ +@@ -1209,7 +1155,7 @@ goto out_err; size = DMA_TABLE_BYTES; @@ -618,7 +619,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c if (!bp->rx_ring) { /* Allocation may have failed due to pci_alloc_consistent insisting on use of GFP_DMA, which is more restrictive -@@ -1215,9 +1161,9 @@ +@@ -1221,9 +1167,9 @@ if (!rx_ring) goto out_err; @@ -630,8 +631,8 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c + DMA_BIDIRECTIONAL); if (dma_mapping_error(rx_ring_dma) || - rx_ring_dma + size > B44_DMA_MASK) { -@@ -1230,9 +1176,9 @@ + rx_ring_dma + size > DMA_30BIT_MASK) { +@@ -1236,9 +1182,9 @@ bp->flags |= B44_FLAG_RX_RING_HACK; } @@ -643,7 +644,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c insisting on use of GFP_DMA, which is more restrictive than necessary... */ struct dma_desc *tx_ring; -@@ -1242,9 +1188,9 @@ +@@ -1248,9 +1194,9 @@ if (!tx_ring) goto out_err; @@ -655,8 +656,8 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c + DMA_TO_DEVICE); if (dma_mapping_error(tx_ring_dma) || - tx_ring_dma + size > B44_DMA_MASK) { -@@ -1279,7 +1225,9 @@ + tx_ring_dma + size > DMA_30BIT_MASK) { +@@ -1285,7 +1231,9 @@ /* bp->lock is held. */ static void b44_chip_reset(struct b44 *bp) { @@ -666,8 +667,8 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c + if (ssb_device_is_enabled(bp->sdev)) { bw32(bp, B44_RCV_LAZY, 0); bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE); - b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 100, 1); -@@ -1291,19 +1239,23 @@ + b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 200, 1); +@@ -1297,19 +1245,23 @@ } bw32(bp, B44_DMARX_CTRL, 0); bp->rx_prod = bp->rx_cons = 0; @@ -699,7 +700,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c br32(bp, B44_MDIO_CTRL); if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) { -@@ -1346,6 +1298,7 @@ +@@ -1352,6 +1304,7 @@ { struct b44 *bp = netdev_priv(dev); struct sockaddr *addr = p; @@ -707,7 +708,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c if (netif_running(dev)) return -EBUSY; -@@ -1356,7 +1309,11 @@ +@@ -1362,7 +1315,11 @@ memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); spin_lock_irq(&bp->lock); @@ -720,7 +721,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c spin_unlock_irq(&bp->lock); return 0; -@@ -1442,18 +1399,6 @@ +@@ -1448,18 +1405,6 @@ return err; } @@ -739,7 +740,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c #ifdef CONFIG_NET_POLL_CONTROLLER /* * Polling receive - used by netconsole and other diagnostic tools -@@ -1568,7 +1513,6 @@ +@@ -1574,7 +1519,6 @@ static void b44_setup_wol(struct b44 *bp) { u32 val; @@ -747,7 +748,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c bw32(bp, B44_RXCONFIG, RXCONFIG_ALLMULTI); -@@ -1592,13 +1536,6 @@ +@@ -1598,13 +1542,6 @@ } else { b44_setup_pseudo_magicp(bp); } @@ -761,7 +762,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c } static int b44_close(struct net_device *dev) -@@ -1698,7 +1635,7 @@ +@@ -1704,7 +1641,7 @@ val = br32(bp, B44_RXCONFIG); val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI); @@ -770,7 +771,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c val |= RXCONFIG_PROMISC; bw32(bp, B44_RXCONFIG, val); } else { -@@ -1745,12 +1682,8 @@ +@@ -1751,12 +1688,8 @@ static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) { @@ -783,7 +784,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c } static int b44_nway_reset(struct net_device *dev) -@@ -2034,6 +1967,245 @@ +@@ -2040,6 +1973,245 @@ .get_perm_addr = ethtool_op_get_perm_addr, }; @@ -1029,7 +1030,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct mii_ioctl_data *data = if_mii(ifr); -@@ -2043,40 +2215,64 @@ +@@ -2049,40 +2221,64 @@ if (!netif_running(dev)) goto out; @@ -1047,7 +1048,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c -static int b44_read_eeprom(struct b44 *bp, u8 *data) -{ - long i; -- u16 *ptr = (u16 *) data; +- __le16 *ptr = (__le16 *) data; + case SIOCGMIIPHY: + data->phy_id = bp->phy_addr; @@ -1119,7 +1120,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n"); -@@ -2085,108 +2281,52 @@ +@@ -2091,108 +2287,52 @@ memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len); @@ -1187,13 +1188,13 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - - pci_set_master(pdev); - -- err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK); +- err = pci_set_dma_mask(pdev, (u64) DMA_30BIT_MASK); - if (err) { - dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); - goto err_out_free_res; - } - -- err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK); +- err = pci_set_consistent_dma_mask(pdev, (u64) DMA_30BIT_MASK); - if (err) { - dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n"); - goto err_out_free_res; @@ -1237,7 +1238,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c bp->rx_pending = B44_DEF_RX_RING_PENDING; bp->tx_pending = B44_DEF_TX_RING_PENDING; -@@ -2205,16 +2345,16 @@ +@@ -2211,16 +2351,16 @@ dev->poll_controller = b44_poll_controller; #endif dev->change_mtu = b44_change_mtu; @@ -1257,7 +1258,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c } bp->mii_if.dev = dev; -@@ -2233,61 +2373,52 @@ +@@ -2239,61 +2379,52 @@ err = register_netdev(dev); if (err) { @@ -1335,8 +1336,8 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c del_timer_sync(&bp->timer); -@@ -2305,19 +2436,15 @@ - b44_init_hw(bp, 0); +@@ -2311,26 +2442,16 @@ + b44_init_hw(bp, B44_PARTIAL_RESET); b44_setup_wol(bp); } - pci_disable_device(pdev); @@ -1350,15 +1351,22 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c - struct net_device *dev = pci_get_drvdata(pdev); + struct net_device *dev = ssb_get_drvdata(pdev); struct b44 *bp = netdev_priv(dev); + int rc = 0; - pci_restore_state(pdev); -- pci_enable_device(pdev); +- rc = pci_enable_device(pdev); +- if (rc) { +- printk(KERN_ERR PFX "%s: pci_enable_device failed\n", +- dev->name); +- return rc; +- } +- - pci_set_master(pdev); - if (!netif_running(dev)) return 0; -@@ -2339,29 +2466,31 @@ +@@ -2356,29 +2477,31 @@ return 0; } @@ -1525,7 +1533,7 @@ diff -urN linux.old/drivers/net/b44.h linux.dev/drivers/net/b44.h diff -urN linux.old/drivers/net/Kconfig linux.dev/drivers/net/Kconfig --- linux.old/drivers/net/Kconfig 2007-01-03 02:25:09.000000000 +0100 +++ linux.dev/drivers/net/Kconfig 2007-01-03 02:26:02.000000000 +0100 -@@ -1525,7 +1525,7 @@ +@@ -1511,7 +1511,7 @@ config B44 tristate "Broadcom 4400 ethernet support" diff --git a/target/linux/brcm47xx-2.6/patches/130-remove_scache.patch b/target/linux/brcm47xx-2.6/patches/130-remove_scache.patch index f56f72f176..1f3b250c42 100644 --- a/target/linux/brcm47xx-2.6/patches/130-remove_scache.patch +++ b/target/linux/brcm47xx-2.6/patches/130-remove_scache.patch @@ -1,7 +1,7 @@ diff -urN linux-2.6.19.ref/arch/mips/Kconfig linux-2.6.19/arch/mips/Kconfig --- linux-2.6.19.ref/arch/mips/Kconfig 2006-12-04 21:33:48.000000000 +0100 +++ linux-2.6.19/arch/mips/Kconfig 2006-12-04 21:34:04.000000000 +0100 -@@ -283,7 +283,6 @@ +@@ -315,7 +315,6 @@ select I8259 select MIPS_BOARDS_GEN select MIPS_BONITO64 @@ -9,7 +9,7 @@ diff -urN linux-2.6.19.ref/arch/mips/Kconfig linux-2.6.19/arch/mips/Kconfig select MIPS_GT64120 select MIPS_MSC select SWAP_IO_SPACE -@@ -1434,13 +1433,6 @@ +@@ -1538,13 +1537,6 @@ bool select BOARD_SCACHE @@ -26,7 +26,7 @@ diff -urN linux-2.6.19.ref/arch/mips/Kconfig linux-2.6.19/arch/mips/Kconfig diff -urN linux-2.6.19.ref/arch/mips/kernel/cpu-probe.c linux-2.6.19/arch/mips/kernel/cpu-probe.c --- linux-2.6.19.ref/arch/mips/kernel/cpu-probe.c 2006-12-04 21:33:48.000000000 +0100 +++ linux-2.6.19/arch/mips/kernel/cpu-probe.c 2006-12-04 21:34:04.000000000 +0100 -@@ -631,6 +631,8 @@ +@@ -619,6 +619,8 @@ break; case PRID_IMP_25KF: c->cputype = CPU_25KF; @@ -84,11 +84,8 @@ diff -urN linux-2.6.19.ref/arch/mips/mm/c-r4k.c linux-2.6.19/arch/mips/mm/c-r4k. diff -urN linux-2.6.19.ref/arch/mips/mm/Makefile linux-2.6.19/arch/mips/mm/Makefile --- linux-2.6.19.ref/arch/mips/mm/Makefile 2006-11-29 22:57:37.000000000 +0100 +++ linux-2.6.19/arch/mips/mm/Makefile 2006-12-04 21:34:04.000000000 +0100 -@@ -30,7 +30,6 @@ +@@ -30,4 +30,3 @@ obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o obj-$(CONFIG_RM7000_CPU_SCACHE) += sc-rm7k.o -obj-$(CONFIG_MIPS_CPU_SCACHE) += sc-mips.o - - # - # Choose one DMA coherency model diff --git a/target/linux/brcm47xx-2.6/patches/150-cpu_fixes.patch b/target/linux/brcm47xx-2.6/patches/150-cpu_fixes.patch index 29d313995f..834c7ee76f 100644 --- a/target/linux/brcm47xx-2.6/patches/150-cpu_fixes.patch +++ b/target/linux/brcm47xx-2.6/patches/150-cpu_fixes.patch @@ -1,7 +1,7 @@ diff -ur linux.old/arch/mips/kernel/genex.S linux.dev/arch/mips/kernel/genex.S --- linux.old/arch/mips/kernel/genex.S 2007-03-23 16:10:35.572499592 +0100 +++ linux.dev/arch/mips/kernel/genex.S 2007-03-16 11:54:34.901251992 +0100 -@@ -50,6 +50,10 @@ +@@ -51,6 +51,10 @@ NESTED(except_vec3_generic, 0, sp) .set push .set noat @@ -74,7 +74,7 @@ diff -ur linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c if (dc_lsize) protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); if (!cpu_icache_snoops_remote_store && scache_size) -@@ -1199,6 +1216,15 @@ +@@ -1173,6 +1190,15 @@ /* Default cache error handler for R4000 and R5000 family */ set_uncached_handler (0x100, &except_vec2_generic, 0x80); @@ -93,7 +93,7 @@ diff -ur linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c diff -ur linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c --- linux.old/arch/mips/mm/tlbex.c 2007-03-16 11:54:34.826263000 +0100 +++ linux.dev/arch/mips/mm/tlbex.c 2007-03-23 16:03:23.608168152 +0100 -@@ -1174,6 +1174,10 @@ +@@ -1229,6 +1229,10 @@ #endif } @@ -104,7 +104,7 @@ diff -ur linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c static void __init build_r4000_tlb_refill_handler(void) { u32 *p = tlb_handler; -@@ -1188,6 +1192,12 @@ +@@ -1243,6 +1247,12 @@ memset(relocs, 0, sizeof(relocs)); memset(final_handler, 0, sizeof(final_handler)); @@ -325,7 +325,7 @@ diff -ur linux.old/include/asm-mips/r4kcache.h linux.dev/include/asm-mips/r4kcac diff -ur linux.old/include/asm-mips/stackframe.h linux.dev/include/asm-mips/stackframe.h --- linux.old/include/asm-mips/stackframe.h 2007-03-23 16:10:35.573499440 +0100 +++ linux.dev/include/asm-mips/stackframe.h 2007-03-16 11:54:34.903251688 +0100 -@@ -334,6 +334,10 @@ +@@ -352,6 +352,10 @@ .macro RESTORE_SP_AND_RET LONG_L sp, PT_R29(sp) .set mips3 diff --git a/target/linux/brcm47xx-2.6/patches/160-kmap_coherent.patch b/target/linux/brcm47xx-2.6/patches/160-kmap_coherent.patch index b8847bd028..706a20f83e 100644 --- a/target/linux/brcm47xx-2.6/patches/160-kmap_coherent.patch +++ b/target/linux/brcm47xx-2.6/patches/160-kmap_coherent.patch @@ -1,6 +1,15 @@ --- ./arch/mips/mm/init.c.orig 2007-03-22 08:08:34.000000000 -0600 +++ ./arch/mips/mm/init.c 2007-03-22 08:09:04.000000000 -0600 @@ -207,7 +207,7 @@ + void *vfrom, *vto; + + vto = kmap_atomic(to, KM_USER1); +- if (cpu_has_dc_aliases) { ++ if (cpu_has_dc_aliases && cpu_use_kmap_coherent) { + vfrom = kmap_coherent(from, vaddr); + copy_page(vto, vfrom); + kunmap_coherent(from); +@@ -230,7 +230,7 @@ struct page *page, unsigned long vaddr, void *dst, const void *src, unsigned long len) { @@ -9,7 +18,7 @@ void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); memcpy(vto, src, len); kunmap_coherent(page); -@@ -223,7 +223,7 @@ +@@ -246,7 +246,7 @@ struct page *page, unsigned long vaddr, void *dst, const void *src, unsigned long len) { @@ -36,7 +45,7 @@ +#endif /* __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H */ --- ./include/asm-mips/cpu-features.h.orig 2007-03-22 08:09:16.000000000 -0600 +++ ./include/asm-mips/cpu-features.h 2007-03-22 08:09:52.000000000 -0600 -@@ -98,6 +98,9 @@ +@@ -101,6 +101,9 @@ #ifndef cpu_has_pindexed_dcache #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX) #endif diff --git a/target/linux/brcm47xx-2.6/patches/170-cpu_wait.patch b/target/linux/brcm47xx-2.6/patches/170-cpu_wait.patch index ee9529a256..ce37b1343e 100644 --- a/target/linux/brcm47xx-2.6/patches/170-cpu_wait.patch +++ b/target/linux/brcm47xx-2.6/patches/170-cpu_wait.patch @@ -1,12 +1,12 @@ diff -urN linux-2.6.19.2.old/arch/mips/kernel/cpu-probe.c linux-2.6.19.2/arch/mips/kernel/cpu-probe.c --- linux-2.6.19.2.old/arch/mips/kernel/cpu-probe.c 2007-05-01 19:28:06.937756121 +0100 +++ linux-2.6.19.2/arch/mips/kernel/cpu-probe.c 2007-05-01 19:31:46.867756121 +0100 -@@ -145,6 +145,8 @@ +@@ -143,6 +143,8 @@ case CPU_34K: case CPU_74K: case CPU_PR4450: + case CPU_BCM3302: + case CPU_BCM4710: cpu_wait = r4k_wait; - printk(" available.\n"); break; + case CPU_TX49XX: diff --git a/target/linux/brcm47xx-2.6/patches/180-b44_timeout.patch b/target/linux/brcm47xx-2.6/patches/180-b44_timeout.patch index 1f8e1deb02..e69de29bb2 100644 --- a/target/linux/brcm47xx-2.6/patches/180-b44_timeout.patch +++ b/target/linux/brcm47xx-2.6/patches/180-b44_timeout.patch @@ -1,12 +0,0 @@ -diff -urN linux-2.6.19.2/drivers/net/b44.c linux-2.6.19.2.new/drivers/net/b44.c ---- linux-2.6.19.2/drivers/net/b44.c 2007-05-03 12:22:54.000000000 +0200 -+++ linux-2.6.19.2.new/drivers/net/b44.c 2007-05-03 12:23:19.000000000 +0200 -@@ -1640,7 +1640,7 @@ - bw32(bp, B44_RXCONFIG, val); - } else { - unsigned char zero[6] = {0, 0, 0, 0, 0, 0}; -- int i = 0; -+ int i = 1; - - __b44_set_mac_addr(bp); -