remove some debugging junk (#492)
[openwrt/svn-archive/archive.git] / openwrt / target / linux / brcm-2.4 / patches / 001-bcm47xx.patch
index 8ed9f0b43b5f2f292ce2c0cda58a3f1740346747..b17b5439452f2bc2d0afbdd127af92a832eb36a3 100644 (file)
@@ -10087,7 +10087,7 @@ diff -urN linux.old/arch/mips/bcm947xx/prom.c linux.dev/arch/mips/bcm947xx/prom.
 diff -urN linux.old/arch/mips/bcm947xx/sbmips.c linux.dev/arch/mips/bcm947xx/sbmips.c
 --- linux.old/arch/mips/bcm947xx/sbmips.c      1970-01-01 01:00:00.000000000 +0100
 +++ linux.dev/arch/mips/bcm947xx/sbmips.c      2006-05-02 04:43:13.000000000 +0200
-@@ -0,0 +1,1145 @@
+@@ -0,0 +1,1132 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane MIPS core routines
 + *
@@ -10162,8 +10162,8 @@ diff -urN linux.old/arch/mips/bcm947xx/sbmips.c linux.dev/arch/mips/bcm947xx/sbm
 + * Returns the MIPS IRQ assignment of the current core. If unassigned,
 + * 0 is returned.
 + */
-+static uint
-+sb_getirq(sb_t *sbh)
++uint
++sb_irq(sb_t *sbh)
 +{
 +      osl_t *osh;
 +      uint idx;
@@ -10196,19 +10196,6 @@ diff -urN linux.old/arch/mips/bcm947xx/sbmips.c linux.dev/arch/mips/bcm947xx/sbm
 +      return irq;
 +}
 +
-+/*
-+ * Return the MIPS IRQ assignment of the current core. If necessary
-+ * map cores sharing the MIPS hw IRQ0 to virtual dedicated OS IRQs.
-+ */
-+uint
-+sb_irq(sb_t *sbh)
-+{
-+      uint irq = sb_getirq(sbh);
-+      if (irq == 0 && shirq_map_base)
-+              irq = sb_getflag(sbh) + shirq_map_base;
-+      return irq;
-+}
-+
 +/* Clears the specified MIPS IRQ. */
 +static void
 +BCMINITFN(sb_clearirq)(sb_t *sbh, uint irq)
@@ -10250,7 +10237,7 @@ diff -urN linux.old/arch/mips/bcm947xx/sbmips.c linux.dev/arch/mips/bcm947xx/sbm
 +      regs = sb_setcore(sbh, coreid, coreunit);
 +      ASSERT(regs);
 +      flag = sb_getflag(sbh);
-+      oldirq = sb_getirq(sbh);
++      oldirq = sb_irq(sbh);
 +      if (oldirq)
 +              sb_clearirq(sbh, oldirq);
 +
@@ -15764,7 +15751,7 @@ diff -urN linux.old/arch/mips/bcm947xx/sflash.c linux.dev/arch/mips/bcm947xx/sfl
 diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.c
 --- linux.old/arch/mips/bcm947xx/time.c        1970-01-01 01:00:00.000000000 +0100
 +++ linux.dev/arch/mips/bcm947xx/time.c        2006-04-28 00:45:40.000000000 +0200
-@@ -0,0 +1,119 @@
+@@ -0,0 +1,104 @@
 +/*
 + * Copyright 2006, Broadcom Corporation
 + * All Rights Reserved.
@@ -15841,13 +15828,6 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.
 +
 +      /* Set panic timeout in seconds */
 +      panic_timeout = watchdog / 1000;
-+
-+      /* Setup blink */
-+      if ((eir = sb_setcore(sbh, SB_EXTIF, 0))) {
-+              sbconfig_t *sb = (sbconfig_t *)((unsigned int) eir + SBCONFIGOFF);
-+              unsigned long base = EXTIF_CFGIF_BASE(sb_base(readl(&sb->sbadmatch1)));
-+              mcr = (u8 *) ioremap_nocache(base + UART_MCR, 1);
-+      }
 +}
 +
 +static void
@@ -15859,14 +15839,6 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.
 +      /* Set the watchdog timer to reset after the specified number of ms */
 +      if (watchdog > 0)
 +              sb_watchdog(sbh, WATCHDOG_CLOCK / 1000 * watchdog);
-+
-+#ifdef        CONFIG_HWSIM
-+      (*((int *)0xa0000f1c))++;
-+#else
-+      /* Blink one of the LEDs in the external UART */
-+      if (mcr && !(jiffies % (HZ/2)))
-+              writeb(readb(mcr) ^ UART_MCR_OUT2, mcr);
-+#endif
 +}
 +
 +static struct irqaction bcm947xx_timer_irqaction = {
@@ -16336,10 +16308,68 @@ diff -urN linux.old/drivers/net/wireless/Config.in linux.dev/drivers/net/wireles
     dep_tristate '    Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.) (EXPERIMENTAL)' CONFIG_PLX_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
     dep_tristate '    Hermes in TMD7160/NCP130 based PCI adaptor support (Pheecom WL-PCI etc.) (EXPERIMENTAL)' CONFIG_TMD_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
     dep_tristate '    Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL)' CONFIG_PCI_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
+diff -urN linux.old/drivers/net/wl/patchtable.pl linux.dev/drivers/net/wl/patchtable.pl
+--- linux.old/drivers/net/wl/patchtable.pl     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/wl/patchtable.pl     2006-04-28 01:33:52.000000000 +0200
+@@ -0,0 +1,54 @@
++#!/usr/bin/perl
++use strict;
++
++my $TABLE = pack("V", 0xbadc0ded);
++my $TABLE_SIZE = 512;
++my $SLT1 = "\x01\x00\x00\x00";
++my $SLT2 = "\x02\x00\x00\x00";
++my $ACKW = "\x03\x00\x00\x00";
++my $PTABLE_END = "\xff\xff\xff\xff";
++
++my $addr = "";
++my $opcode = "";
++my $function = "";
++
++sub add_entry {
++      my $key = shift;
++      my $value = shift;
++      my $default = shift;
++
++      $TABLE .= $key;
++      $TABLE .= pack("V", $value);
++      $TABLE .= pack("V", $default);
++}
++
++while (<>) {
++      $addr = $opcode = "";
++      /^\w{8}\s*<(.*)>:$/ and $function = $1;
++      /^\s*(\w+):\s*(\w{8})\s*/ and do {
++              $addr = $1;
++              $opcode = $2;
++      };
++
++      ($function eq 'wlc_update_slot_timing') and do {
++              # li    a2,9    -- short slot time
++              ($opcode eq '24060009') and add_entry($SLT1, hex($addr), hex($opcode));
++              # li    v0,519  -- 510 + short slot time
++              ($opcode eq '24020207') and add_entry($SLT2, hex($addr), hex($opcode));
++              
++              # li    a2,20   -- long slot time
++              ($opcode eq '24060014') and add_entry($SLT1, hex($addr), hex($opcode));
++              # li    v0,530  -- 510 + long slot time
++              ($opcode eq '24020212') and add_entry($SLT2, hex($addr), hex($opcode));
++      };
++      ($function eq 'wlc_d11hdrs') and do {
++              # ori   s6,s6,0x1 -- ack flag (new)
++              ($opcode eq '36d60001') and add_entry($ACKW, hex($addr), hex($opcode));
++              # ori   s3,s3,0x1 -- ack flag (old)
++              ($opcode eq '36730001') and add_entry($ACKW, hex($addr), hex($opcode));
++      }
++}
++
++$TABLE .= $PTABLE_END;
++$TABLE .= ("\x00" x ($TABLE_SIZE - length($TABLE)));
++print $TABLE;
 diff -urN linux.old/drivers/net/wl/Makefile linux.dev/drivers/net/wl/Makefile
 --- linux.old/drivers/net/wl/Makefile  1970-01-01 01:00:00.000000000 +0100
 +++ linux.dev/drivers/net/wl/Makefile  2006-04-28 01:33:52.000000000 +0200
-@@ -0,0 +1,26 @@
+@@ -0,0 +1,32 @@
 +#
 +# Makefile for the Broadcom wl driver
 +#
@@ -16355,7 +16385,7 @@ diff -urN linux.old/drivers/net/wl/Makefile linux.dev/drivers/net/wl/Makefile
 +
 +EXTRA_CFLAGS += -I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
 +
-+O_TARGET      := wl.o
++O_TARGET      := wl_link.o
 +
 +obj-y         := wl_mod.o
 +obj-y         += bcmutils.o hnddma.o linux_osl.o
@@ -16365,6 +16395,12 @@ diff -urN linux.old/drivers/net/wl/Makefile linux.dev/drivers/net/wl/Makefile
 +wl_mod.o: wl_apsta.o
 +      sed -e 's,eth%d,wl%d\x00,g' < $< > $@
 +
++wl.o: wl_link.o
++      $(OBJDUMP) -d $< | perl patchtable.pl > patchtable.bin
++      cat wl_link.o patchtable.bin > $@
++
++modules: wl.o
++
 +include $(TOPDIR)/Rules.make
 diff -urN linux.old/drivers/net/wl/bcmip.h linux.dev/drivers/net/wl/bcmip.h
 --- linux.old/drivers/net/wl/bcmip.h   1970-01-01 01:00:00.000000000 +0100