From c67bb3dce4ee5c3bc124d395740bd03155b18fec Mon Sep 17 00:00:00 2001 From: msaitoh Date: Fri, 2 Sep 2011 03:16:18 +0000 Subject: [PATCH] Add support for some fxp devices from FreeBSD and OpenBSD. {Free,Open}BSD say that we have to do some work to make fxp stable. --- sys/dev/ic/i82557.c | 11 +- sys/dev/ic/i82557reg.h | 6 +- sys/dev/microcode/i8255x/rcvbundl.h | 149 +++++++++++++++++++++++++++- sys/dev/pci/if_fxp_pci.c | 54 ++++++++-- 4 files changed, 204 insertions(+), 16 deletions(-) diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index 9bf16ee126ba..a6151a56951b 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.137 2011/03/30 17:52:45 jakllsch Exp $ */ +/* $NetBSD: i82557.c,v 1.138 2011/09/02 03:16:18 msaitoh Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.137 2011/03/30 17:52:45 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.138 2011/09/02 03:16:18 msaitoh Exp $"); #include "rnd.h" @@ -2329,6 +2329,7 @@ static const uint32_t fxp_ucode_d101ma[] = D101M_B_RCVBUNDLE_UCODE; static const uint32_t fxp_ucode_d101s[] = D101S_RCVBUNDLE_UCODE; static const uint32_t fxp_ucode_d102[] = D102_B_RCVBUNDLE_UCODE; static const uint32_t fxp_ucode_d102c[] = D102_C_RCVBUNDLE_UCODE; +static const uint32_t fxp_ucode_d102e[] = D102_E_RCVBUNDLE_UCODE; #define UCODE(x) x, sizeof(x)/sizeof(uint32_t) @@ -2357,6 +2358,12 @@ static const struct ucode { { FXP_REV_82550_C, UCODE(fxp_ucode_d102c), D102_C_CPUSAVER_DWORD, D102_C_CPUSAVER_BUNDLE_MAX_DWORD }, + { FXP_REV_82551_F, UCODE(fxp_ucode_d102e), + D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, + + { FXP_REV_82551_10, UCODE(fxp_ucode_d102e), + D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, + { 0, NULL, 0, 0, 0 } }; diff --git a/sys/dev/ic/i82557reg.h b/sys/dev/ic/i82557reg.h index 74a046a74ab4..3aa2c1db6dcb 100644 --- a/sys/dev/ic/i82557reg.h +++ b/sys/dev/ic/i82557reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: i82557reg.h,v 1.24 2009/04/17 15:37:43 tsutsui Exp $ */ +/* $NetBSD: i82557reg.h,v 1.25 2011/09/02 03:16:19 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc. @@ -529,4 +529,6 @@ struct fxp_stats { #define FXP_REV_82559S_A 9 #define FXP_REV_82550 12 #define FXP_REV_82550_C 13 -#define FXP_REV_82551 15 +#define FXP_REV_82551_E 14 /* 82551 */ +#define FXP_REV_82551_F 15 +#define FXP_REV_82551_10 16 /* 82551 */ diff --git a/sys/dev/microcode/i8255x/rcvbundl.h b/sys/dev/microcode/i8255x/rcvbundl.h index 337c2e139245..fa9f3d24b696 100644 --- a/sys/dev/microcode/i8255x/rcvbundl.h +++ b/sys/dev/microcode/i8255x/rcvbundl.h @@ -1,4 +1,4 @@ -/* $NetBSD: rcvbundl.h,v 1.3 2005/12/11 12:22:27 christos Exp $ */ +/* $NetBSD: rcvbundl.h,v 1.4 2011/09/02 03:16:18 msaitoh Exp $ */ /* Copyright (c) 1999-2001, Intel Corporation @@ -1126,3 +1126,150 @@ rcvbundl.h file given above). 0x00000000, \ 0x00000000, \ } + +/********************************************************/ +/* Micro code for the D102 E-step */ +/********************************************************/ + +/* Parameter values for the D102 E-step */ +#define D102_E_CPUSAVER_DWORD 42 +#define D102_E_CPUSAVER_BUNDLE_MAX_DWORD 54 +#define D102_E_CPUSAVER_MIN_SIZE_DWORD 46 + +#define D102_E_RCVBUNDLE_UCODE \ +{\ +0x007D028F, \ +0x0E4204F9, \ +0x14ED0C85, \ +0x14FA14E9, \ +0x0EF70E36, \ +0x1FFF1FFF, \ +0x00E014B9, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00E014BD, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00E014D5, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00E014C1, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00E014C8, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00200600, \ +0x00E014EE, \ +0x00000000, \ +0x00000000, \ +0x0030FF80, \ +0x00940E46, \ +0x00038200, \ +0x00102000, \ +0x00E00E43, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00300006, \ +0x00E014FB, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00906E41, \ +0x00800E3C, \ +0x00E00E39, \ +0x00000000, \ +0x00906EFD, \ +0x00900EFD, \ +0x00E00EF8, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +0x00000000, \ +} diff --git a/sys/dev/pci/if_fxp_pci.c b/sys/dev/pci/if_fxp_pci.c index fc311754a563..fc6e14df7487 100644 --- a/sys/dev/pci/if_fxp_pci.c +++ b/sys/dev/pci/if_fxp_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_fxp_pci.c,v 1.75 2011/05/17 17:34:54 dyoung Exp $ */ +/* $NetBSD: if_fxp_pci.c,v 1.76 2011/09/02 03:16:18 msaitoh Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.75 2011/05/17 17:34:54 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.76 2011/09/02 03:16:18 msaitoh Exp $"); #include "rnd.h" @@ -100,18 +100,16 @@ static const struct fxp_pci_product { uint32_t fpp_prodid; /* PCI product ID */ const char *fpp_name; /* device name */ } fxp_pci_products[] = { + { PCI_PRODUCT_INTEL_82552, + "Intel i82552 10/100 Network Connection" }, { PCI_PRODUCT_INTEL_82557, "Intel i82557 Ethernet" }, { PCI_PRODUCT_INTEL_82559ER, "Intel i82559ER Ethernet" }, { PCI_PRODUCT_INTEL_IN_BUSINESS, "Intel InBusiness Ethernet" }, - { PCI_PRODUCT_INTEL_82801BA_LAN, - "Intel i82562 Ethernet" }, - { PCI_PRODUCT_INTEL_82801E_LAN_1, - "Intel i82801E Ethernet" }, - { PCI_PRODUCT_INTEL_82801E_LAN_2, - "Intel i82801E Ethernet" }, + { PCI_PRODUCT_INTEL_PRO_100, + "Intel PRO/100 Ethernet" }, { PCI_PRODUCT_INTEL_PRO_100_VE_0, "Intel PRO/100 VE Network Controller" }, { PCI_PRODUCT_INTEL_PRO_100_VE_1, @@ -130,6 +128,12 @@ static const struct fxp_pci_product { "Intel PRO/100 VE Network Controller" }, { PCI_PRODUCT_INTEL_PRO_100_VE_8, "Intel PRO/100 VE Network Controller" }, + { PCI_PRODUCT_INTEL_PRO_100_VE_9, + "Intel PRO/100 VE Network Controller" }, + { PCI_PRODUCT_INTEL_PRO_100_VE_10, + "Intel PRO/100 VE Network Controller" }, + { PCI_PRODUCT_INTEL_PRO_100_VE_11, + "Intel PRO/100 VE Network Controller" }, { PCI_PRODUCT_INTEL_PRO_100_VM_0, "Intel PRO/100 VM Network Controller" }, { PCI_PRODUCT_INTEL_PRO_100_VM_1, @@ -144,12 +148,40 @@ static const struct fxp_pci_product { "Intel PRO/100 VM (MOB) Network Controller" }, { PCI_PRODUCT_INTEL_PRO_100_VM_6, "Intel PRO/100 VM Network Controller with 82562ET/EZ PHY" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_7, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_8, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_9, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_10, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_11, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_12, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_13, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_14, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_15, + "Intel PRO/100 VM Network Connection" }, + { PCI_PRODUCT_INTEL_PRO_100_VM_16, + "Intel PRO/100 VM Network Connection" }, { PCI_PRODUCT_INTEL_PRO_100_M, "Intel PRO/100 M Network Controller" }, + { PCI_PRODUCT_INTEL_82801BA_LAN, + "Intel i82562 Ethernet" }, + { PCI_PRODUCT_INTEL_82801E_LAN_1, + "Intel i82801E Ethernet" }, + { PCI_PRODUCT_INTEL_82801E_LAN_2, + "Intel i82801E Ethernet" }, { PCI_PRODUCT_INTEL_82801EB_LAN, "Intel 82801EB/ER (ICH5) Network Controller" }, { PCI_PRODUCT_INTEL_82801FB_LAN, - "Intel 82562EZ (ICH6)" }, + "Intel i82801FB LAN Controller" }, + { PCI_PRODUCT_INTEL_82801FB_LAN_2, + "Intel i82801FB LAN Controller" }, { PCI_PRODUCT_INTEL_82801G_LAN, "Intel 82801GB/GR (ICH7) Network Controller" }, { PCI_PRODUCT_INTEL_82801GB_LAN, @@ -369,7 +401,7 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) sc->sc_flags &= ~FXPF_82559_RXCSUM; sc->sc_flags |= FXPF_EXT_RFA; } - if (sc->sc_rev >= FXP_REV_82551) + if (sc->sc_rev >= FXP_REV_82551_E) chipname = "i82551 Ethernet"; /* @@ -398,7 +430,7 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) if (pa->pa_flags & PCI_FLAGS_MWI_OKAY) sc->sc_flags |= FXPF_MWI; - if (sc->sc_rev >= FXP_REV_82551) + if (sc->sc_rev >= FXP_REV_82551_E) chipname = "Intel i82551ER Ethernet"; aprint_normal(": %s, rev %d\n", chipname != NULL ? chipname :