* [PATCH 4/12] [NET] Improve description of MV643XX_ETH
[not found] <20060320043802.GA20389@deprecation.cyrius.com>
@ 2006-03-20 4:39 ` Martin Michlmayr
2006-03-20 4:39 ` [PATCH 5/12] [NET] Bring declance.c in sync with linux-mips tree Martin Michlmayr
2006-03-20 4:40 ` [PATCH 6/12] [NET] Support the BCM1x55 and BCM1x80 chips Martin Michlmayr
2 siblings, 0 replies; 3+ messages in thread
From: Martin Michlmayr @ 2006-03-20 4:39 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linux-mips, netdev
Slightly improve the wording of the description of MV643XX_ETH
in Kconfig. This difference was found between the mainline and
linux-mips kernel trees.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
--- linux-2.6/drivers/net/Kconfig 2006-03-13 18:55:59.000000000 +0000
+++ mips.git/drivers/net/Kconfig 2006-03-13 18:43:52.000000000 +0000
@@ -2197,8 +2213,8 @@
depends on MOMENCO_OCELOT_C || MOMENCO_JAGUAR_ATX || MV64360 || MOMENCO_OCELOT_3 || PPC_MULTIPLATFORM
help
This driver supports the gigabit Ethernet on the Marvell MV643XX
- chipset which is used in the Momenco Ocelot C and Jaguar ATX and
- Pegasos II, amongst other PPC and MIPS boards.
+ chipset which is used in the Momenco Ocelot C Ocelot, Jaguar ATX
+ and Pegasos II, amongst other PPC and MIPS boards.
config MV643XX_ETH_0
bool "MV-643XX Port 0"
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 5/12] [NET] Bring declance.c in sync with linux-mips tree
[not found] <20060320043802.GA20389@deprecation.cyrius.com>
2006-03-20 4:39 ` [PATCH 4/12] [NET] Improve description of MV643XX_ETH Martin Michlmayr
@ 2006-03-20 4:39 ` Martin Michlmayr
2006-03-20 4:40 ` [PATCH 6/12] [NET] Support the BCM1x55 and BCM1x80 chips Martin Michlmayr
2 siblings, 0 replies; 3+ messages in thread
From: Martin Michlmayr @ 2006-03-20 4:39 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linux-mips, netdev
There are three changes between the Linus' and linux-mips git trees
regarding the declaner driver. Two are cosmetic and one fixes a
call to the wrong function.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
--- linux-2.6/drivers/net/declance.c 2006-03-05 19:35:04.000000000 +0000
+++ mips.git/drivers/net/declance.c 2006-03-05 18:51:15.000000000 +0000
@@ -704,8 +704,8 @@
return IRQ_HANDLED;
}
-static irqreturn_t
-lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t lance_interrupt(const int irq, void *dev_id,
+ struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
struct lance_private *lp = netdev_priv(dev);
@@ -1255,7 +1255,7 @@
return 0;
err_out_free_dev:
- kfree(dev);
+ free_netdev(dev);
err_out:
return ret;
@@ -1301,6 +1301,7 @@
while (root_lance_dev) {
struct net_device *dev = root_lance_dev;
struct lance_private *lp = netdev_priv(dev);
+
unregister_netdev(dev);
#ifdef CONFIG_TC
if (lp->slot >= 0)
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 6/12] [NET] Support the BCM1x55 and BCM1x80 chips
[not found] <20060320043802.GA20389@deprecation.cyrius.com>
2006-03-20 4:39 ` [PATCH 4/12] [NET] Improve description of MV643XX_ETH Martin Michlmayr
2006-03-20 4:39 ` [PATCH 5/12] [NET] Bring declance.c in sync with linux-mips tree Martin Michlmayr
@ 2006-03-20 4:40 ` Martin Michlmayr
2 siblings, 0 replies; 3+ messages in thread
From: Martin Michlmayr @ 2006-03-20 4:40 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linux-mips, netdev
From: Broadcom Corporation
Add support for the BCM1x55 and BCM1x80 chips. The BCM1x80 features
four Ethernet devices. This patch has been in the linux-mips tree
for several months and has also been tested by Debian.
Signed-off-by: Andy Isaacson <adi@broadcom.com>
Signed-off-by: Mark E Mason <mark.e.mason@broadcom.com>
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
--- linux-2.6/drivers/net/sb1250-mac.c 2006-03-05 19:35:04.000000000 +0000
+++ mips.git/drivers/net/sb1250-mac.c 2006-03-05 18:51:16.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001,2002,2003 Broadcom Corporation
+ * Copyright (C) 2001,2002,2003,2004 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -43,6 +43,7 @@
#define SBMAC_ETH0_HWADDR "40:00:00:00:01:00"
#define SBMAC_ETH1_HWADDR "40:00:00:00:01:01"
#define SBMAC_ETH2_HWADDR "40:00:00:00:01:02"
+#define SBMAC_ETH3_HWADDR "40:00:00:00:01:03"
#endif
@@ -57,7 +58,7 @@
#define CONFIG_SBMAC_COALESCE
-#define MAX_UNITS 3 /* More are supported, limit only on options */
+#define MAX_UNITS 4 /* More are supported, limit only on options */
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (2*HZ)
@@ -85,11 +86,11 @@
The media type is usually passed in 'options[]'.
*/
#ifdef MODULE
-static int options[MAX_UNITS] = {-1, -1, -1};
+static int options[MAX_UNITS] = {-1, -1, -1, -1};
module_param_array(options, int, NULL, S_IRUGO);
MODULE_PARM_DESC(options, "1-" __MODULE_STRING(MAX_UNITS));
-static int full_duplex[MAX_UNITS] = {-1, -1, -1};
+static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1};
module_param_array(full_duplex, int, NULL, S_IRUGO);
MODULE_PARM_DESC(full_duplex, "1-" __MODULE_STRING(MAX_UNITS));
#endif
@@ -105,13 +106,26 @@
#endif
#include <asm/sibyte/sb1250.h>
-#include <asm/sibyte/sb1250_defs.h>
+#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
+#include <asm/sibyte/bcm1480_regs.h>
+#include <asm/sibyte/bcm1480_int.h>
+#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
#include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/sb1250_mac.h>
-#include <asm/sibyte/sb1250_dma.h>
#include <asm/sibyte/sb1250_int.h>
+#else
+#error invalid SiByte MAC configuation
+#endif
#include <asm/sibyte/sb1250_scd.h>
+#include <asm/sibyte/sb1250_mac.h>
+#include <asm/sibyte/sb1250_dma.h>
+#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
+#define UNIT_INT(n) (K_BCM1480_INT_MAC_0 + ((n) * 2))
+#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
+#define UNIT_INT(n) (K_INT_MAC_0 + (n))
+#else
+#error invalid SiByte MAC configuation
+#endif
/**********************************************************************
* Simple types
@@ -142,6 +156,10 @@
#define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES)
+#define SBMAC_READCSR(t) __raw_readq((unsigned long)t)
+#define SBMAC_WRITECSR(t,v) __raw_writeq(v, (unsigned long)t)
+
+
#define SBMAC_MAX_TXDESCR 32
#define SBMAC_MAX_RXDESCR 32
@@ -1476,10 +1494,10 @@
* and make sure that RD_THRSH + WR_THRSH <=128 for pass2 and above
* Use a larger RD_THRSH for gigabit
*/
- if (periph_rev >= 2)
- th_value = 64;
- else
+ if (soc_type == K_SYS_SOC_TYPE_BCM1250 && periph_rev < 2)
th_value = 28;
+ else
+ th_value = 64;
fifo = V_MAC_TX_WR_THRSH(4) | /* Must be '4' or '8' */
((s->sbm_speed == sbmac_speed_1000)
@@ -1589,13 +1607,17 @@
* Turn on the rest of the bits in the enable register
*/
+#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
+ __raw_writeq(M_MAC_RXDMA_EN0 |
+ M_MAC_TXDMA_EN0, s->sbm_macenable);
+#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
__raw_writeq(M_MAC_RXDMA_EN0 |
M_MAC_TXDMA_EN0 |
M_MAC_RX_ENABLE |
M_MAC_TX_ENABLE, s->sbm_macenable);
-
-
-
+#else
+#error invalid SiByte MAC configuation
+#endif
#ifdef CONFIG_SBMAC_COALESCE
/*
@@ -1786,11 +1808,12 @@
reg &= ~M_MAC_IPHDR_OFFSET | V_MAC_IPHDR_OFFSET(15);
__raw_writeq(reg, sc->sbm_rxfilter);
- /* read system identification to determine revision */
- if (periph_rev >= 2) {
- sc->rx_hw_checksum = ENABLE;
- } else {
+ /* BCM1250 pass1 didn't have hardware checksum. Everything
+ later does. */
+ if (soc_type == K_SYS_SOC_TYPE_BCM1250 && periph_rev < 2) {
sc->rx_hw_checksum = DISABLE;
+ } else {
+ sc->rx_hw_checksum = ENABLE;
}
}
@@ -2220,7 +2243,7 @@
-#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR)
+#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
/**********************************************************************
* SBMAC_PARSE_XDIGIT(str)
*
@@ -2397,6 +2420,11 @@
sc->sbm_dev->name);
}
+ if (periph_rev >= 2) {
+ printk(KERN_INFO "%s: enabling TCP rcv checksum\n",
+ sc->sbm_dev->name);
+ }
+
/*
* Display Ethernet address (this is called during the config
* process so we need to finish off the config message that
@@ -2792,7 +2820,7 @@
-#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR)
+#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
static void
sbmac_setup_hwaddr(int chan,char *addr)
{
@@ -2818,25 +2846,7 @@
unsigned long port;
int chip_max_units;
- /*
- * For bringup when not using the firmware, we can pre-fill
- * the MAC addresses using the environment variables
- * specified in this file (or maybe from the config file?)
- */
-#ifdef SBMAC_ETH0_HWADDR
- sbmac_setup_hwaddr(0,SBMAC_ETH0_HWADDR);
-#endif
-#ifdef SBMAC_ETH1_HWADDR
- sbmac_setup_hwaddr(1,SBMAC_ETH1_HWADDR);
-#endif
-#ifdef SBMAC_ETH2_HWADDR
- sbmac_setup_hwaddr(2,SBMAC_ETH2_HWADDR);
-#endif
-
- /*
- * Walk through the Ethernet controllers and find
- * those who have their MAC addresses set.
- */
+ /* Set the number of available units based on the SOC type. */
switch (soc_type) {
case K_SYS_SOC_TYPE_BCM1250:
case K_SYS_SOC_TYPE_BCM1250_ALT:
@@ -2848,6 +2858,10 @@
case K_SYS_SOC_TYPE_BCM1250_ALT2: /* Hybrid */
chip_max_units = 2;
break;
+ case K_SYS_SOC_TYPE_BCM1x55:
+ case K_SYS_SOC_TYPE_BCM1x80:
+ chip_max_units = 4;
+ break;
default:
chip_max_units = 0;
break;
@@ -2855,6 +2869,32 @@
if (chip_max_units > MAX_UNITS)
chip_max_units = MAX_UNITS;
+ /*
+ * For bringup when not using the firmware, we can pre-fill
+ * the MAC addresses using the environment variables
+ * specified in this file (or maybe from the config file?)
+ */
+#ifdef SBMAC_ETH0_HWADDR
+ if (chip_max_units > 0)
+ sbmac_setup_hwaddr(0,SBMAC_ETH0_HWADDR);
+#endif
+#ifdef SBMAC_ETH1_HWADDR
+ if (chip_max_units > 1)
+ sbmac_setup_hwaddr(1,SBMAC_ETH1_HWADDR);
+#endif
+#ifdef SBMAC_ETH2_HWADDR
+ if (chip_max_units > 2)
+ sbmac_setup_hwaddr(2,SBMAC_ETH2_HWADDR);
+#endif
+#ifdef SBMAC_ETH3_HWADDR
+ if (chip_max_units > 3)
+ sbmac_setup_hwaddr(3,SBMAC_ETH3_HWADDR);
+#endif
+
+ /*
+ * Walk through the Ethernet controllers and find
+ * those who have their MAC addresses set.
+ */
for (idx = 0; idx < chip_max_units; idx++) {
/*
@@ -2886,7 +2926,7 @@
printk(KERN_DEBUG "sbmac: configuring MAC at %lx\n", port);
- dev->irq = K_INT_MAC_0 + idx;
+ dev->irq = UNIT_INT(idx);
dev->base_addr = port;
dev->mem_end = 0;
if (sbmac_init(dev, idx)) {
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-20 4:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20060320043802.GA20389@deprecation.cyrius.com>
2006-03-20 4:39 ` [PATCH 4/12] [NET] Improve description of MV643XX_ETH Martin Michlmayr
2006-03-20 4:39 ` [PATCH 5/12] [NET] Bring declance.c in sync with linux-mips tree Martin Michlmayr
2006-03-20 4:40 ` [PATCH 6/12] [NET] Support the BCM1x55 and BCM1x80 chips Martin Michlmayr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).