From owner-svn-src-stable-10@freebsd.org Thu Jan 14 15:48:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D044A82EAF; Thu, 14 Jan 2016 15:48:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A98613E5; Thu, 14 Jan 2016 15:48:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EFmBsw049946; Thu, 14 Jan 2016 15:48:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EFmA2t049943; Thu, 14 Jan 2016 15:48:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201601141548.u0EFmA2t049943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 14 Jan 2016 15:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293975 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 15:48:12 -0000 Author: arybchik Date: Thu Jan 14 15:48:10 2016 New Revision: 293975 URL: https://svnweb.freebsd.org/changeset/base/293975 Log: MFC r293731 sfxge: add Medford PCI IDs to common code Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Thu Jan 14 15:46:53 2016 (r293974) +++ stable/10/sys/dev/sfxge/common/efx.h Thu Jan 14 15:48:10 2016 (r293975) @@ -61,6 +61,7 @@ typedef enum efx_family_e { EFX_FAMILY_FALCON, EFX_FAMILY_SIENA, EFX_FAMILY_HUNTINGTON, + EFX_FAMILY_MEDFORD, EFX_FAMILY_NTYPES } efx_family_t; @@ -90,6 +91,9 @@ efx_infer_family( #define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */ #define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */ +#define EFX_PCI_DEVID_MEDFORD_PF_UNINIT 0x0913 +#define EFX_PCI_DEVID_MEDFORD 0x0A03 /* SFC9240 PF */ +#define EFX_PCI_DEVID_MEDFORD_VF 0x1A03 /* SFC9240 VF */ #define EFX_MEM_BAR 2 @@ -1153,11 +1157,11 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD uint32_t enc_pf; uint32_t enc_vf; uint32_t enc_privilege_mask; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ boolean_t enc_bug26807_workaround; boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 15:46:53 2016 (r293974) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Thu Jan 14 15:48:10 2016 (r293975) @@ -797,6 +797,10 @@ struct efx_txq_s { rev = 'D'; \ break; \ \ + case EFX_FAMILY_MEDFORD: \ + rev = 'E'; \ + break; \ + \ default: \ rev = '?'; \ break; \ Modified: stable/10/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 15:46:53 2016 (r293974) +++ stable/10/sys/dev/sfxge/common/efx_nic.c Thu Jan 14 15:48:10 2016 (r293975) @@ -49,7 +49,8 @@ efx_family( case EFX_PCI_DEVID_FALCON: *efp = EFX_FAMILY_FALCON; return (0); -#endif +#endif /* EFSYS_OPT_FALCON */ + #if EFSYS_OPT_SIENA case EFX_PCI_DEVID_SIENA_F1_UNINIT: /* @@ -63,7 +64,7 @@ efx_family( case EFX_PCI_DEVID_SIENA: *efp = EFX_FAMILY_SIENA; return (0); -#endif +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT: @@ -83,7 +84,26 @@ efx_family( case EFX_PCI_DEVID_GREENPORT_VF: *efp = EFX_FAMILY_HUNTINGTON; return (0); -#endif +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_PCI_DEVID_MEDFORD_PF_UNINIT: + /* + * Hardware default for PF0 of uninitialised Medford. + * manftest must be able to cope with this device id. + */ + *efp = EFX_FAMILY_MEDFORD; + return (0); + + case EFX_PCI_DEVID_MEDFORD: + *efp = EFX_FAMILY_MEDFORD; + return (0); + + case EFX_PCI_DEVID_MEDFORD_VF: + *efp = EFX_FAMILY_MEDFORD; + return (0); +#endif /* EFSYS_OPT_MEDFORD */ + default: break; } @@ -110,8 +130,12 @@ efx_infer_family( EFSYS_BAR_READO(esbp, FR_AZ_CS_DEBUG_REG_OFST, &oword, B_TRUE); portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM); - switch (portnum) { - case 0: { + if ((portnum == 1) || (portnum == 2)) { +#if EFSYS_OPT_SIENA + family = EFX_FAMILY_SIENA; + goto out; +#endif + } else if (portnum == 0) { efx_dword_t dword; uint32_t hw_rev; @@ -119,31 +143,25 @@ efx_infer_family( B_TRUE); hw_rev = EFX_DWORD_FIELD(dword, ERF_DZ_HW_REV_ID); if (hw_rev == ER_DZ_BIU_HW_REV_ID_REG_RESET) { -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + /* + * BIU_HW_REV_ID is the same for Huntington and Medford. + * Assume Huntington, as Medford is very similar. + */ family = EFX_FAMILY_HUNTINGTON; - break; + goto out; #endif } else { #if EFSYS_OPT_FALCON family = EFX_FAMILY_FALCON; - break; + goto out; #endif } - rc = ENOTSUP; - goto fail1; - } - -#if EFSYS_OPT_SIENA - case 1: - case 2: - family = EFX_FAMILY_SIENA; - break; -#endif - default: - rc = ENOTSUP; - goto fail1; } + rc = ENOTSUP; + goto fail1; +out: if (efp != NULL) *efp = family; return (0);