From owner-p4-projects@FreeBSD.ORG Fri Nov 28 07:16:31 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 915551065673; Fri, 28 Nov 2008 07:16:31 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8A11065672 for ; Fri, 28 Nov 2008 07:16:31 +0000 (UTC) (envelope-from zec@tel.fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 249728FC18 for ; Fri, 28 Nov 2008 07:16:31 +0000 (UTC) (envelope-from zec@tel.fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mAS7GV44081871 for ; Fri, 28 Nov 2008 07:16:31 GMT (envelope-from zec@tel.fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mAS7GUwg081869 for perforce@freebsd.org; Fri, 28 Nov 2008 07:16:30 GMT (envelope-from zec@tel.fer.hr) Date: Fri, 28 Nov 2008 07:16:30 GMT Message-Id: <200811280716.mAS7GUwg081869@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@tel.fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 153684 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 07:16:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=153684 Change 153684 by zec@zec_tca51 on 2008/11/28 07:15:35 IFC @ 153681 Affected files ... .. //depot/projects/vimage-commit/src/sys/amd64/include/pmc_mdep.h#5 integrate .. //depot/projects/vimage-commit/src/sys/boot/arm/uboot/Makefile#2 integrate .. //depot/projects/vimage-commit/src/sys/conf/files.amd64#5 integrate .. //depot/projects/vimage-commit/src/sys/conf/files.i386#9 integrate .. //depot/projects/vimage-commit/src/sys/dev/aac/aac_pci.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/ata/ata-queue.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_80003es2lan.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82540.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82541.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82542.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82543.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82571.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82575.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82575.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_api.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_api.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_defines.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_hw.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_ich8lan.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_ich8lan.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_mac.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_mac.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_manage.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_nvm.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_osdep.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_osdep.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_phy.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_phy.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_regs.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/if_em.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/if_em.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/e1000/if_igb.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/fxp/if_fxp.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/fxp/if_fxpreg.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/fxp/if_fxpvar.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/hwpmc_core.c#1 branch .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/hwpmc_core.h#1 branch .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/hwpmc_intel.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/hwpmc_logging.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/hwpmc_mod.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/hwpmc/pmc_events.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe.h#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_82598.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_api.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_api.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_common.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_common.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_osdep.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_phy.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_phy.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe_type.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/sbni/if_sbni.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/sbni/if_sbni_isa.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/sbni/if_sbni_pci.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/sbni/if_sbnireg.h#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/sbni/if_sbnivar.h#4 integrate .. //depot/projects/vimage-commit/src/sys/fs/cd9660/cd9660_node.c#4 integrate .. //depot/projects/vimage-commit/src/sys/i386/include/pmc_mdep.h#4 integrate .. //depot/projects/vimage-commit/src/sys/kern/kern_conf.c#9 integrate .. //depot/projects/vimage-commit/src/sys/kern/kern_lockf.c#5 integrate .. //depot/projects/vimage-commit/src/sys/modules/hwpmc/Makefile#4 integrate .. //depot/projects/vimage-commit/src/sys/modules/sbni/Makefile#4 integrate .. //depot/projects/vimage-commit/src/sys/netinet/in_pcb.c#11 integrate .. //depot/projects/vimage-commit/src/sys/netinet/ip_output.c#9 integrate .. //depot/projects/vimage-commit/src/sys/netinet/sctp_pcb.c#9 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_output.c#11 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_timewait.c#8 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_usrreq.c#9 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/in6_pcb.c#10 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/in6_pcb.h#5 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/raw_ip6.c#10 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/udp6_usrreq.c#9 integrate .. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.c#12 integrate .. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.h#8 integrate .. //depot/projects/vimage-commit/src/sys/netipsec/ipsec6.h#4 integrate .. //depot/projects/vimage-commit/src/sys/sys/param.h#11 integrate .. //depot/projects/vimage-commit/src/sys/sys/pmc.h#4 integrate .. //depot/projects/vimage-commit/src/sys/sys/pmclog.h#3 integrate Differences ... ==== //depot/projects/vimage-commit/src/sys/amd64/include/pmc_mdep.h#5 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/pmc_mdep.h,v 1.7 2008/11/09 17:37:54 jkoshy Exp $ + * $FreeBSD: src/sys/amd64/include/pmc_mdep.h,v 1.8 2008/11/27 09:00:47 jkoshy Exp $ */ /* Machine dependent interfaces */ @@ -40,6 +40,7 @@ #endif #include +#include #include #include @@ -51,8 +52,8 @@ #define PMC_MDEP_CLASS_INDEX_TSC 0 #define PMC_MDEP_CLASS_INDEX_K8 1 #define PMC_MDEP_CLASS_INDEX_P4 1 -#define PMC_MDEP_CLASS_INDEX_IAF 1 -#define PMC_MDEP_CLASS_INDEX_IAP 2 +#define PMC_MDEP_CLASS_INDEX_IAP 1 +#define PMC_MDEP_CLASS_INDEX_IAF 2 /* * On the amd64 platform we support the following PMCs. @@ -66,6 +67,8 @@ union pmc_md_op_pmcallocate { struct pmc_md_amd_op_pmcallocate pm_amd; + struct pmc_md_iaf_op_pmcallocate pm_iaf; + struct pmc_md_iap_op_pmcallocate pm_iap; struct pmc_md_p4_op_pmcallocate pm_p4; uint64_t __pad[4]; }; @@ -78,6 +81,8 @@ union pmc_md_pmc { struct pmc_md_amd_pmc pm_amd; + struct pmc_md_iaf_pmc pm_iaf; + struct pmc_md_iap_pmc pm_iap; struct pmc_md_p4_pmc pm_p4; }; ==== //depot/projects/vimage-commit/src/sys/boot/arm/uboot/Makefile#2 (text+ko) ==== @@ -1,10 +1,9 @@ -# $FreeBSD: src/sys/boot/arm/uboot/Makefile,v 1.2 2008/11/19 17:34:28 raj Exp $ +# $FreeBSD: src/sys/boot/arm/uboot/Makefile,v 1.3 2008/11/27 16:53:01 raj Exp $ PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} BINDIR?= /boot INSTALLFLAGS= -b -NO_MAN= WARNS?= 1 # Architecture-specific loader code @@ -61,7 +60,7 @@ CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c ${PROG}.help +CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding @@ -86,11 +85,11 @@ vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -${PROG}.help: help.common help.uboot +loader.help: help.common help.uboot cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth -FILES= ${PROG}.help +FILES= loader.help .include ==== //depot/projects/vimage-commit/src/sys/conf/files.amd64#5 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.124 2008/11/09 17:37:54 jkoshy Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.125 2008/11/27 09:00:47 jkoshy Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -189,6 +189,7 @@ dev/hptrr/hptrr_config.c optional hptrr dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_intel.c optional hwpmc +dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc ==== //depot/projects/vimage-commit/src/sys/conf/files.i386#9 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.609 2008/11/09 17:37:54 jkoshy Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.610 2008/11/27 09:00:47 jkoshy Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -187,6 +187,7 @@ dev/hptrr/hptrr_config.c optional hptrr dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_intel.c optional hwpmc +dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_pentium.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc ==== //depot/projects/vimage-commit/src/sys/dev/aac/aac_pci.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.69 2008/09/12 18:15:12 emaste Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.70 2008/11/27 20:26:02 emaste Exp $"); /* * PCI bus interface and resource allocation. @@ -168,8 +168,6 @@ "ICP ICP9014RO SCSI RAID"}, {0x9005, 0x0285, 0x9005, 0x0294, AAC_HWIF_I960RX, 0, "Adaptec SATA RAID 2026ZCR"}, - {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, 0, - "Adaptec SATA RAID 2610SA"}, {0x9005, 0x0285, 0x9005, 0x0296, AAC_HWIF_I960RX, 0, "Adaptec SCSI RAID 2240S"}, {0x9005, 0x0285, 0x9005, 0x0297, AAC_HWIF_I960RX, 0, ==== //depot/projects/vimage-commit/src/sys/dev/ata/ata-queue.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.74 2008/10/27 09:26:24 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.75 2008/11/27 03:37:46 peter Exp $"); #include "opt_ata.h" #include @@ -357,7 +357,7 @@ "\6MEDIA_CHANGED\5NID_NOT_FOUND" "\4MEDIA_CHANGE_REQEST" "\3ABORTED\2NO_MEDIA\1ILLEGAL_LENGTH"); - if ((request->flags & ATA_R_DMA) && + if ((request->flags & ATA_R_DMA) && request->dma && (request->dma->status & ATA_BMSTAT_ERROR)) printf(" dma=0x%02x", request->dma->status); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) ==== //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_80003es2lan.c#3 (text+ko) ==== @@ -30,9 +30,11 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: src/sys/dev/e1000/e1000_80003es2lan.c,v 1.1 2008/07/30 21:56:53 jfv Exp $*/ +/*$FreeBSD: src/sys/dev/e1000/e1000_80003es2lan.c,v 1.2 2008/11/26 23:57:23 jfv Exp $*/ -/* e1000_80003es2lan +/* + * 80003ES2LAN Gigabit Ethernet Controller (Copper) + * 80003ES2LAN Gigabit Ethernet Controller (Serdes) */ #include "e1000_api.h" @@ -41,7 +43,9 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw); +static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw); static void e1000_release_phy_80003es2lan(struct e1000_hw *hw); +static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw); static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw); static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, @@ -64,6 +68,11 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask); static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex); static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw); +static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw); +static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, + u16 *data); +static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, + u16 data); static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw); static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw); static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask); @@ -84,8 +93,6 @@ /** * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs. * @hw: pointer to the HW structure - * - * This is a function pointer entry point called by the api module. **/ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw) { @@ -122,6 +129,8 @@ phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan; phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan; + phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan; + /* This can only be done after all function pointers are setup. */ ret_val = e1000_get_phy_id(hw); @@ -138,8 +147,6 @@ /** * e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs. * @hw: pointer to the HW structure - * - * This is a function pointer entry point called by the api module. **/ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw) { @@ -197,8 +204,6 @@ /** * e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs. * @hw: pointer to the HW structure - * - * This is a function pointer entry point called by the api module. **/ static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw) { @@ -280,8 +285,6 @@ /* turn on/off LED */ mac->ops.led_on = e1000_led_on_generic; mac->ops.led_off = e1000_led_off_generic; - /* remove device */ - mac->ops.remove_device = e1000_remove_device_generic; /* clear hardware counters */ mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_80003es2lan; /* link info */ @@ -295,8 +298,7 @@ * e1000_init_function_pointers_80003es2lan - Init ESB2 func ptrs. * @hw: pointer to the HW structure * - * The only function explicitly called by the api module to initialize - * all function pointers and parameters. + * Called to initialize all function pointers and parameters. **/ void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw) { @@ -305,14 +307,14 @@ hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan; hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan; hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan; + e1000_get_bus_info_pcie_generic(hw); } /** * e1000_acquire_phy_80003es2lan - Acquire rights to access PHY * @hw: pointer to the HW structure * - * A wrapper to acquire access rights to the correct PHY. This is a - * function pointer entry point called by the api module. + * A wrapper to acquire access rights to the correct PHY. **/ static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw) { @@ -321,8 +323,6 @@ DEBUGFUNC("e1000_acquire_phy_80003es2lan"); mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; - mask |= E1000_SWFW_CSR_SM; - return e1000_acquire_swfw_sync_80003es2lan(hw, mask); } @@ -330,8 +330,7 @@ * e1000_release_phy_80003es2lan - Release rights to access PHY * @hw: pointer to the HW structure * - * A wrapper to release access rights to the correct PHY. This is a - * function pointer entry point called by the api module. + * A wrapper to release access rights to the correct PHY. **/ static void e1000_release_phy_80003es2lan(struct e1000_hw *hw) { @@ -340,7 +339,41 @@ DEBUGFUNC("e1000_release_phy_80003es2lan"); mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; - mask |= E1000_SWFW_CSR_SM; + e1000_release_swfw_sync_80003es2lan(hw, mask); +} + + +/** + * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register + * @hw: pointer to the HW structure + * + * Acquire the semaphore to access the Kumeran interface. + * + **/ +static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw) +{ + u16 mask; + + DEBUGFUNC("e1000_acquire_mac_csr_80003es2lan"); + + mask = E1000_SWFW_CSR_SM; + + return e1000_acquire_swfw_sync_80003es2lan(hw, mask); +} + +/** + * e1000_release_mac_csr_80003es2lan - Release rights to access Kumeran Register + * @hw: pointer to the HW structure + * + * Release the semaphore used to access the Kumeran interface + **/ +static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw) +{ + u16 mask; + + DEBUGFUNC("e1000_release_mac_csr_80003es2lan"); + + mask = E1000_SWFW_CSR_SM; e1000_release_swfw_sync_80003es2lan(hw, mask); } @@ -349,8 +382,7 @@ * e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM * @hw: pointer to the HW structure * - * Acquire the semaphore to access the EEPROM. This is a function - * pointer entry point called by the api module. + * Acquire the semaphore to access the EEPROM. **/ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw) { @@ -375,8 +407,7 @@ * e1000_release_nvm_80003es2lan - Relinquish rights to access NVM * @hw: pointer to the HW structure * - * Release the semaphore used to access the EEPROM. This is a - * function pointer entry point called by the api module. + * Release the semaphore used to access the EEPROM. **/ static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw) { @@ -400,7 +431,7 @@ u32 swmask = mask; u32 fwmask = mask << 16; s32 ret_val = E1000_SUCCESS; - s32 i = 0, timeout = 200; + s32 i = 0, timeout = 50; DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan"); @@ -452,8 +483,8 @@ DEBUGFUNC("e1000_release_swfw_sync_80003es2lan"); - while (e1000_get_hw_semaphore_generic(hw) != E1000_SUCCESS); - /* Empty */ + while (e1000_get_hw_semaphore_generic(hw) != E1000_SUCCESS) + ; /* Empty */ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); swfw_sync &= ~mask; @@ -468,8 +499,7 @@ * @offset: offset of the register to read * @data: pointer to the data returned from the operation * - * Read the GG82563 PHY register. This is a function pointer entry - * point called by the api module. + * Read the GG82563 PHY register. **/ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data) @@ -520,9 +550,8 @@ usec_delay(200); - ret_val = e1000_read_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, - data); + ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, + data); usec_delay(200); e1000_release_phy_80003es2lan(hw); @@ -537,8 +566,7 @@ * @offset: offset of the register to read * @data: value to write to the register * - * Write to the GG82563 PHY register. This is a function pointer entry - * point called by the api module. + * Write to the GG82563 PHY register. **/ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data) @@ -590,8 +618,7 @@ usec_delay(200); - ret_val = e1000_write_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, + ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, data); usec_delay(200); @@ -608,8 +635,7 @@ * @words: number of words to write * @data: buffer of data to write to the NVM * - * Write "words" of data to the ESB2 NVM. This is a function - * pointer entry point called by the api module. + * Write "words" of data to the ESB2 NVM. **/ static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) @@ -775,10 +801,17 @@ goto out; index = phy_data & GG82563_DSPD_CABLE_LENGTH; - phy->min_cable_length = e1000_gg82563_cable_length_table[index]; - phy->max_cable_length = e1000_gg82563_cable_length_table[index+5]; + + if (index < GG82563_CABLE_LENGTH_TABLE_SIZE + 5) { + phy->min_cable_length = e1000_gg82563_cable_length_table[index]; + phy->max_cable_length = + e1000_gg82563_cable_length_table[index+5]; - phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; + phy->cable_length = (phy->min_cable_length + + phy->max_cable_length) / 2; + } else { + ret_val = E1000_ERR_PHY; + } out: return ret_val; @@ -791,7 +824,6 @@ * @duplex: pointer to duplex buffer * * Retrieve the current speed and duplex configuration. - * This is a function pointer entry point called by the api module. **/ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed, u16 *duplex) @@ -804,20 +836,13 @@ ret_val = e1000_get_speed_and_duplex_copper_generic(hw, speed, duplex); - if (ret_val) - goto out; - if (*speed == SPEED_1000) - ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw); - else - ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw, - *duplex); + hw->phy.ops.cfg_on_link_up(hw); } else { ret_val = e1000_get_speed_and_duplex_fiber_serdes_generic(hw, speed, duplex); } -out: return ret_val; } @@ -826,7 +851,6 @@ * @hw: pointer to the HW structure * * Perform a global reset to the ESB2 controller. - * This is a function pointer entry point called by the api module. **/ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) { @@ -840,9 +864,8 @@ * on the last TLP read/write transaction when MAC is reset. */ ret_val = e1000_disable_pcie_master_generic(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("PCI-E Master disable polling has failed.\n"); - } DEBUGOUT("Masking off all interrupts\n"); E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); @@ -855,8 +878,10 @@ ctrl = E1000_READ_REG(hw, E1000_CTRL); + ret_val = e1000_acquire_phy_80003es2lan(hw); DEBUGOUT("Issuing a global reset to MAC\n"); E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); + e1000_release_phy_80003es2lan(hw); ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) @@ -878,7 +903,6 @@ * @hw: pointer to the HW structure * * Initialize the hw bits, LED, VFTA, MTA, link and hw counters. - * This is a function pointer entry point called by the api module. **/ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) { @@ -969,9 +993,6 @@ DEBUGFUNC("e1000_initialize_hw_bits_80003es2lan"); - if (hw->mac.disable_hw_init_bits) - goto out; - /* Transmit Descriptor Control 0 */ reg = E1000_READ_REG(hw, E1000_TXDCTL(0)); reg |= (1 << 22); @@ -997,7 +1018,6 @@ reg |= (1 << 28); E1000_WRITE_REG(hw, E1000_TARC(1), reg); -out: return; } @@ -1012,8 +1032,7 @@ struct e1000_phy_info *phy = &hw->phy; s32 ret_val; u32 ctrl_ext; - u32 i = 0; - u16 data, data2; + u16 data; DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan"); @@ -1084,20 +1103,20 @@ } /* Bypass Rx and Tx FIFO's */ - ret_val = e1000_write_kmrn_reg_generic(hw, + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS); if (ret_val) goto out; - ret_val = e1000_read_kmrn_reg_generic(hw, + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, &data); if (ret_val) goto out; data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE; - ret_val = e1000_write_kmrn_reg_generic(hw, + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, data); if (ret_val) @@ -1129,30 +1148,20 @@ /* Enable Electrical Idle on the PHY */ data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; ret_val = hw->phy.ops.write_reg(hw, - GG82563_PHY_PWR_MGMT_CTRL, - data); + GG82563_PHY_PWR_MGMT_CTRL, + data); if (ret_val) goto out; - - do { - ret_val = hw->phy.ops.read_reg(hw, - GG82563_PHY_KMRN_MODE_CTRL, - &data); + ret_val = hw->phy.ops.read_reg(hw, + GG82563_PHY_KMRN_MODE_CTRL, + &data); if (ret_val) goto out; - ret_val = hw->phy.ops.read_reg(hw, - GG82563_PHY_KMRN_MODE_CTRL, - &data2); - if (ret_val) - goto out; - i++; - } while ((data != data2) && (i < GG82563_MAX_KMRN_RETRY)); - data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; ret_val = hw->phy.ops.write_reg(hw, - GG82563_PHY_KMRN_MODE_CTRL, - data); + GG82563_PHY_KMRN_MODE_CTRL, + data); if (ret_val) goto out; @@ -1185,7 +1194,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw) { u32 ctrl; - s32 ret_val; + s32 ret_val; u16 reg_data; DEBUGFUNC("e1000_setup_copper_link_80003es2lan"); @@ -1200,26 +1209,26 @@ * iteration and increase the max iterations when * polling the phy; this fixes erroneous timeouts at 10Mbps. */ - ret_val = e1000_write_kmrn_reg_generic(hw, GG82563_REG(0x34, 4), - 0xFFFF); + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4), + 0xFFFF); if (ret_val) goto out; - ret_val = e1000_read_kmrn_reg_generic(hw, GG82563_REG(0x34, 9), - ®_data); + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), + ®_data); if (ret_val) goto out; reg_data |= 0x3F; - ret_val = e1000_write_kmrn_reg_generic(hw, GG82563_REG(0x34, 9), - reg_data); + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), + reg_data); if (ret_val) goto out; - ret_val = e1000_read_kmrn_reg_generic(hw, + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, ®_data); if (ret_val) goto out; reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING; - ret_val = e1000_write_kmrn_reg_generic(hw, + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, reg_data); if (ret_val) @@ -1236,6 +1245,40 @@ } /** + * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up + * @hw: pointer to the HW structure + * @duplex: current duplex setting + * + * Configure the KMRN interface by applying last minute quirks for + * 10/100 operation. + **/ +static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 speed; + u16 duplex; + + DEBUGFUNC("e1000_configure_on_link_up"); + + if (hw->phy.media_type == e1000_media_type_copper) { + + ret_val = e1000_get_speed_and_duplex_copper_generic(hw, + &speed, + &duplex); + if (ret_val) + goto out; + + if (speed == SPEED_1000) + ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw); + else + ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw, duplex); + } + +out: + return ret_val; +} + +/** * e1000_cfg_kmrn_10_100_80003es2lan - Apply "quirks" for 10/100 operation * @hw: pointer to the HW structure * @duplex: current duplex setting @@ -1253,7 +1296,7 @@ DEBUGFUNC("e1000_configure_kmrn_for_10_100"); reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT; - ret_val = e1000_write_kmrn_reg_generic(hw, + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data); if (ret_val) @@ -1268,12 +1311,12 @@ do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data); + ®_data); if (ret_val) goto out; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data2); + ®_data2); if (ret_val) goto out; i++; @@ -1307,7 +1350,7 @@ DEBUGFUNC("e1000_configure_kmrn_for_1000"); reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT; - ret_val = e1000_write_kmrn_reg_generic(hw, + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data); if (ret_val) @@ -1322,12 +1365,12 @@ do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data); + ®_data); if (ret_val) goto out; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data2); + ®_data2); if (ret_val) goto out; i++; @@ -1341,6 +1384,75 @@ } /** + * e1000_read_kmrn_reg_80003es2lan - Read kumeran register + * @hw: pointer to the HW structure + * @offset: register offset to be read + * @data: pointer to the read data + * + * Acquire semaphore, then read the PHY register at offset + * using the kumeran interface. The information retrieved is stored in data. + * Release the semaphore before exiting. + **/ +s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data) +{ + u32 kmrnctrlsta; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_read_kmrn_reg_80003es2lan"); + + ret_val = e1000_acquire_mac_csr_80003es2lan(hw); + if (ret_val) + goto out; + + kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & + E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN; + E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta); + + usec_delay(2); + + kmrnctrlsta = E1000_READ_REG(hw, E1000_KMRNCTRLSTA); + *data = (u16)kmrnctrlsta; + + e1000_release_mac_csr_80003es2lan(hw); + +out: + return ret_val; +} + +/** + * e1000_write_kmrn_reg_80003es2lan - Write kumeran register + * @hw: pointer to the HW structure + * @offset: register offset to write to + * @data: data to write at register offset + * + * Acquire semaphore, then write the data to PHY register + * at the offset using the kumeran interface. Release semaphore + * before exiting. + **/ +s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data) +{ + u32 kmrnctrlsta; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_write_kmrn_reg_80003es2lan"); + + ret_val = e1000_acquire_mac_csr_80003es2lan(hw); + if (ret_val) + goto out; + + kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & + E1000_KMRNCTRLSTA_OFFSET) | data; + E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta); + + usec_delay(2); + + e1000_release_mac_csr_80003es2lan(hw); + +out: + return ret_val; +} + +/** * e1000_read_mac_addr_80003es2lan - Read device MAC address * @hw: pointer to the HW structure **/ @@ -1380,44 +1492,42 @@ **/ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw) { - volatile u32 temp; - DEBUGFUNC("e1000_clear_hw_cntrs_80003es2lan"); e1000_clear_hw_cntrs_base_generic(hw); - temp = E1000_READ_REG(hw, E1000_PRC64); - temp = E1000_READ_REG(hw, E1000_PRC127); - temp = E1000_READ_REG(hw, E1000_PRC255); - temp = E1000_READ_REG(hw, E1000_PRC511); - temp = E1000_READ_REG(hw, E1000_PRC1023); - temp = E1000_READ_REG(hw, E1000_PRC1522); - temp = E1000_READ_REG(hw, E1000_PTC64); - temp = E1000_READ_REG(hw, E1000_PTC127); - temp = E1000_READ_REG(hw, E1000_PTC255); - temp = E1000_READ_REG(hw, E1000_PTC511); - temp = E1000_READ_REG(hw, E1000_PTC1023); - temp = E1000_READ_REG(hw, E1000_PTC1522); + E1000_READ_REG(hw, E1000_PRC64); + E1000_READ_REG(hw, E1000_PRC127); + E1000_READ_REG(hw, E1000_PRC255); + E1000_READ_REG(hw, E1000_PRC511); + E1000_READ_REG(hw, E1000_PRC1023); + E1000_READ_REG(hw, E1000_PRC1522); + E1000_READ_REG(hw, E1000_PTC64); + E1000_READ_REG(hw, E1000_PTC127); + E1000_READ_REG(hw, E1000_PTC255); + E1000_READ_REG(hw, E1000_PTC511); + E1000_READ_REG(hw, E1000_PTC1023); + E1000_READ_REG(hw, E1000_PTC1522); - temp = E1000_READ_REG(hw, E1000_ALGNERRC); - temp = E1000_READ_REG(hw, E1000_RXERRC); - temp = E1000_READ_REG(hw, E1000_TNCRS); - temp = E1000_READ_REG(hw, E1000_CEXTERR); - temp = E1000_READ_REG(hw, E1000_TSCTC); - temp = E1000_READ_REG(hw, E1000_TSCTFC); + E1000_READ_REG(hw, E1000_ALGNERRC); + E1000_READ_REG(hw, E1000_RXERRC); + E1000_READ_REG(hw, E1000_TNCRS); + E1000_READ_REG(hw, E1000_CEXTERR); + E1000_READ_REG(hw, E1000_TSCTC); + E1000_READ_REG(hw, E1000_TSCTFC); - temp = E1000_READ_REG(hw, E1000_MGTPRC); - temp = E1000_READ_REG(hw, E1000_MGTPDC); - temp = E1000_READ_REG(hw, E1000_MGTPTC); + E1000_READ_REG(hw, E1000_MGTPRC); + E1000_READ_REG(hw, E1000_MGTPDC); + E1000_READ_REG(hw, E1000_MGTPTC); - temp = E1000_READ_REG(hw, E1000_IAC); - temp = E1000_READ_REG(hw, E1000_ICRXOC); + E1000_READ_REG(hw, E1000_IAC); + E1000_READ_REG(hw, E1000_ICRXOC); - temp = E1000_READ_REG(hw, E1000_ICRXPTC); - temp = E1000_READ_REG(hw, E1000_ICRXATC); - temp = E1000_READ_REG(hw, E1000_ICTXPTC); - temp = E1000_READ_REG(hw, E1000_ICTXATC); - temp = E1000_READ_REG(hw, E1000_ICTXQEC); - temp = E1000_READ_REG(hw, E1000_ICTXQMTC); - temp = E1000_READ_REG(hw, E1000_ICRXDMTC); + E1000_READ_REG(hw, E1000_ICRXPTC); + E1000_READ_REG(hw, E1000_ICRXATC); + E1000_READ_REG(hw, E1000_ICTXPTC); + E1000_READ_REG(hw, E1000_ICTXATC); + E1000_READ_REG(hw, E1000_ICTXQEC); + E1000_READ_REG(hw, E1000_ICTXQMTC); + E1000_READ_REG(hw, E1000_ICRXDMTC); } ==== //depot/projects/vimage-commit/src/sys/dev/e1000/e1000_82540.c#3 (text+ko) ==== @@ -30,13 +30,17 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: src/sys/dev/e1000/e1000_82540.c,v 1.1 2008/07/30 21:56:53 jfv Exp $*/ +/*$FreeBSD: src/sys/dev/e1000/e1000_82540.c,v 1.2 2008/11/26 23:57:23 jfv Exp $*/ -/* e1000_82540 - * e1000_82545 - * e1000_82546 - * e1000_82545_rev_3 - * e1000_82546_rev_3 +/* >>> TRUNCATED FOR MAIL (1000 lines) <<<