diff options
| -rw-r--r-- | drivers/net/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/net/Makefile | 1 | ||||
| -rw-r--r-- | drivers/net/ixp2000/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/net/ixp2000/Makefile | 3 | ||||
| -rw-r--r-- | drivers/net/ixp2000/caleb.c | 136 | ||||
| -rw-r--r-- | drivers/net/ixp2000/caleb.h | 22 | ||||
| -rw-r--r-- | drivers/net/ixp2000/enp2611.c | 238 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400-msf.c | 213 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400-msf.h | 115 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400_rx.uc | 408 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400_rx.ucode | 130 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400_tx.uc | 272 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixp2400_tx.ucode | 98 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixpdev.c | 404 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixpdev.h | 27 | ||||
| -rw-r--r-- | drivers/net/ixp2000/ixpdev_priv.h | 57 | ||||
| -rw-r--r-- | drivers/net/ixp2000/pm3386.c | 304 | ||||
| -rw-r--r-- | drivers/net/ixp2000/pm3386.h | 26 |
18 files changed, 2462 insertions, 0 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 39415b5c4569..fca6000d6e01 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -1901,6 +1901,8 @@ config E1000_NAPI | |||
| 1901 | 1901 | ||
| 1902 | If in doubt, say N. | 1902 | If in doubt, say N. |
| 1903 | 1903 | ||
| 1904 | source "drivers/net/ixp2000/Kconfig" | ||
| 1905 | |||
| 1904 | config MYRI_SBUS | 1906 | config MYRI_SBUS |
| 1905 | tristate "MyriCOM Gigabit Ethernet support" | 1907 | tristate "MyriCOM Gigabit Ethernet support" |
| 1906 | depends on SBUS | 1908 | depends on SBUS |
diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 505681406314..b74a7cb5bae6 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile | |||
| @@ -206,6 +206,7 @@ obj-$(CONFIG_NET_TULIP) += tulip/ | |||
| 206 | obj-$(CONFIG_HAMRADIO) += hamradio/ | 206 | obj-$(CONFIG_HAMRADIO) += hamradio/ |
| 207 | obj-$(CONFIG_IRDA) += irda/ | 207 | obj-$(CONFIG_IRDA) += irda/ |
| 208 | obj-$(CONFIG_ETRAX_ETHERNET) += cris/ | 208 | obj-$(CONFIG_ETRAX_ETHERNET) += cris/ |
| 209 | obj-$(CONFIG_ENP2611_MSF_NET) += ixp2000/ | ||
| 209 | 210 | ||
| 210 | obj-$(CONFIG_NETCONSOLE) += netconsole.o | 211 | obj-$(CONFIG_NETCONSOLE) += netconsole.o |
| 211 | 212 | ||
diff --git a/drivers/net/ixp2000/Kconfig b/drivers/net/ixp2000/Kconfig new file mode 100644 index 000000000000..2fec2415651f --- /dev/null +++ b/drivers/net/ixp2000/Kconfig | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | config ENP2611_MSF_NET | ||
| 2 | tristate "Radisys ENP2611 MSF network interface support" | ||
| 3 | depends on ARCH_ENP2611 | ||
| 4 | help | ||
| 5 | This is a driver for the MSF network interface unit in | ||
| 6 | the IXP2400 on the Radisys ENP2611 platform. | ||
diff --git a/drivers/net/ixp2000/Makefile b/drivers/net/ixp2000/Makefile new file mode 100644 index 000000000000..fd38351ceaa7 --- /dev/null +++ b/drivers/net/ixp2000/Makefile | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | obj-$(CONFIG_ENP2611_MSF_NET) += enp2611_mod.o | ||
| 2 | |||
| 3 | enp2611_mod-objs := caleb.o enp2611.o ixp2400-msf.o ixpdev.o pm3386.o | ||
diff --git a/drivers/net/ixp2000/caleb.c b/drivers/net/ixp2000/caleb.c new file mode 100644 index 000000000000..d70530adb1e2 --- /dev/null +++ b/drivers/net/ixp2000/caleb.c | |||
| @@ -0,0 +1,136 @@ | |||
| 1 | /* | ||
| 2 | * Helper functions for the SPI-3 bridge FPGA on the Radisys ENP2611 | ||
| 3 | * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org> | ||
| 4 | * Dedicated to Marija Kulikova. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/config.h> | ||
| 13 | #include <linux/module.h> | ||
| 14 | #include <linux/delay.h> | ||
| 15 | #include <asm/io.h> | ||
| 16 | |||
| 17 | #define CALEB_IDLO 0x00 | ||
| 18 | #define CALEB_IDHI 0x01 | ||
| 19 | #define CALEB_RID 0x02 | ||
| 20 | #define CALEB_RESET 0x03 | ||
| 21 | #define CALEB_INTREN0 0x04 | ||
| 22 | #define CALEB_INTREN1 0x05 | ||
| 23 | #define CALEB_INTRSTAT0 0x06 | ||
| 24 | #define CALEB_INTRSTAT1 0x07 | ||
| 25 | #define CALEB_PORTEN 0x08 | ||
| 26 | #define CALEB_BURST 0x09 | ||
| 27 | #define CALEB_PORTPAUS 0x0A | ||
| 28 | #define CALEB_PORTPAUSD 0x0B | ||
| 29 | #define CALEB_PHY0RX 0x10 | ||
| 30 | #define CALEB_PHY1RX 0x11 | ||
| 31 | #define CALEB_PHY0TX 0x12 | ||
| 32 | #define CALEB_PHY1TX 0x13 | ||
| 33 | #define CALEB_IXPRX_HI_CNTR 0x15 | ||
| 34 | #define CALEB_PHY0RX_HI_CNTR 0x16 | ||
| 35 | #define CALEB_PHY1RX_HI_CNTR 0x17 | ||
| 36 | #define CALEB_IXPRX_CNTR 0x18 | ||
| 37 | #define CALEB_PHY0RX_CNTR 0x19 | ||
| 38 | #define CALEB_PHY1RX_CNTR 0x1A | ||
| 39 | #define CALEB_IXPTX_CNTR 0x1B | ||
| 40 | #define CALEB_PHY0TX_CNTR 0x1C | ||
| 41 | #define CALEB_PHY1TX_CNTR 0x1D | ||
| 42 | #define CALEB_DEBUG0 0x1E | ||
| 43 | #define CALEB_DEBUG1 0x1F | ||
| 44 | |||
| 45 | |||
| 46 | static u8 caleb_reg_read(int reg) | ||
| 47 | { | ||
| 48 | u8 value; | ||
| 49 | |||
| 50 | value = *((volatile u8 *)(ENP2611_CALEB_VIRT_BASE + reg)); | ||
| 51 | |||
| 52 | // printk(KERN_INFO "caleb_reg_read(%d) = %.2x\n", reg, value); | ||
| 53 | |||
| 54 | return value; | ||
| 55 | } | ||
| 56 | |||
| 57 | static void caleb_reg_write(int reg, u8 value) | ||
| 58 | { | ||
| 59 | u8 dummy; | ||
| 60 | |||
| 61 | // printk(KERN_INFO "caleb_reg_write(%d, %.2x)\n", reg, value); | ||
| 62 | |||
| 63 | *((volatile u8 *)(ENP2611_CALEB_VIRT_BASE + reg)) = value; | ||
| 64 | |||
| 65 | dummy = *((volatile u8 *)ENP2611_CALEB_VIRT_BASE); | ||
| 66 | __asm__ __volatile__("mov %0, %0" : "+r" (dummy)); | ||
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | void caleb_reset(void) | ||
| 71 | { | ||
| 72 | /* | ||
| 73 | * Perform a chip reset. | ||
| 74 | */ | ||
| 75 | caleb_reg_write(CALEB_RESET, 0x02); | ||
| 76 | udelay(1); | ||
| 77 | |||
| 78 | /* | ||
| 79 | * Enable all interrupt sources. This is needed to get | ||
| 80 | * meaningful results out of the status bits (register 6 | ||
| 81 | * and 7.) | ||
| 82 | */ | ||
| 83 | caleb_reg_write(CALEB_INTREN0, 0xff); | ||
| 84 | caleb_reg_write(CALEB_INTREN1, 0x07); | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Set RX and TX FIFO thresholds to 1.5kb. | ||
| 88 | */ | ||
| 89 | caleb_reg_write(CALEB_PHY0RX, 0x11); | ||
| 90 | caleb_reg_write(CALEB_PHY1RX, 0x11); | ||
| 91 | caleb_reg_write(CALEB_PHY0TX, 0x11); | ||
| 92 | caleb_reg_write(CALEB_PHY1TX, 0x11); | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Program SPI-3 burst size. | ||
| 96 | */ | ||
| 97 | caleb_reg_write(CALEB_BURST, 0); // 64-byte RBUF mpackets | ||
| 98 | // caleb_reg_write(CALEB_BURST, 1); // 128-byte RBUF mpackets | ||
| 99 | // caleb_reg_write(CALEB_BURST, 2); // 256-byte RBUF mpackets | ||
| 100 | } | ||
| 101 | |||
| 102 | void caleb_enable_rx(int port) | ||
| 103 | { | ||
| 104 | u8 temp; | ||
| 105 | |||
| 106 | temp = caleb_reg_read(CALEB_PORTEN); | ||
| 107 | temp |= 1 << port; | ||
| 108 | caleb_reg_write(CALEB_PORTEN, temp); | ||
| 109 | } | ||
| 110 | |||
| 111 | void caleb_disable_rx(int port) | ||
| 112 | { | ||
| 113 | u8 temp; | ||
| 114 | |||
| 115 | temp = caleb_reg_read(CALEB_PORTEN); | ||
| 116 | temp &= ~(1 << port); | ||
| 117 | caleb_reg_write(CALEB_PORTEN, temp); | ||
| 118 | } | ||
| 119 | |||
| 120 | void caleb_enable_tx(int port) | ||
| 121 | { | ||
| 122 | u8 temp; | ||
| 123 | |||
| 124 | temp = caleb_reg_read(CALEB_PORTEN); | ||
| 125 | temp |= 1 << (port + 4); | ||
| 126 | caleb_reg_write(CALEB_PORTEN, temp); | ||
| 127 | } | ||
| 128 | |||
| 129 | void caleb_disable_tx(int port) | ||
| 130 | { | ||
| 131 | u8 temp; | ||
| 132 | |||
| 133 | temp = caleb_reg_read(CALEB_PORTEN); | ||
| 134 | temp &= ~(1 << (port + 4)); | ||
| 135 | caleb_reg_write(CALEB_PORTEN, temp); | ||
| 136 | } | ||
diff --git a/drivers/net/ixp2000/caleb.h b/drivers/net/ixp2000/caleb.h new file mode 100644 index 000000000000..e93a1ef5b8a3 --- /dev/null +++ b/drivers/net/ixp2000/caleb.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * Helper functions for the SPI-3 bridge FPGA on the Radisys ENP2611 | ||
