1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

sfxge: add Medford PCI IDs to common code

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4856
This commit is contained in:
Andrew Rybchenko 2016-01-12 06:32:56 +00:00
parent 8883918d66
commit 34f6ea2980
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293731
3 changed files with 49 additions and 23 deletions

View File

@ -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;

View File

@ -797,6 +797,10 @@ struct efx_txq_s {
rev = 'D'; \
break; \
\
case EFX_FAMILY_MEDFORD: \
rev = 'E'; \
break; \
\
default: \
rev = '?'; \
break; \

View File

@ -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);