Re: em(4): add a mac type for Meteor Lake

Jonathan Matthew <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
On Wed, Aug 05, 2026 at 12:23:47PM +1000, Jonathan Gray wrote:
> needed for generation specific workarounds
> 
> tested on 0x550b / E1000_DEV_ID_PCH_MTP_I219_V18

ok jmatthew@

> 
> diff --git sys/dev/pci/if_em.c sys/dev/pci/if_em.c
> index 5121269ef22..49d2e79333f 100644
> --- sys/dev/pci/if_em.c
> +++ sys/dev/pci/if_em.c
> @@ -513,6 +513,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
>  		case em_pch_cnp:
>  		case em_pch_tgp:
>  		case em_pch_adp:
> +		case em_pch_mtp:
>  		case em_80003es2lan:
>  			/* 9K Jumbo Frame size */
>  			sc->hw.max_frame_size = 9234;
> @@ -929,6 +930,7 @@ em_init(void *arg)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		pba = E1000_PBA_26K;
>  		break;
>  	default:
> diff --git sys/dev/pci/if_em_hw.c sys/dev/pci/if_em_hw.c
> index 0d2c0869df2..0fa41af15fc 100644
> --- sys/dev/pci/if_em_hw.c
> +++ sys/dev/pci/if_em_hw.c
> @@ -665,7 +665,7 @@ em_set_mac_type(struct em_hw *hw)
>  	case E1000_DEV_ID_PCH_LNP_I219_V21:
>  	case E1000_DEV_ID_PCH_ARL_I219_LM24:
>  	case E1000_DEV_ID_PCH_ARL_I219_V24:
> -		hw->mac_type = em_pch_adp;	/* pch_mtp */
> +		hw->mac_type = em_pch_mtp;
>  		break;
>  	case E1000_DEV_ID_EP80579_LAN_1:
>  		hw->mac_type = em_icp_xxxx;
> @@ -701,6 +701,7 @@ em_set_mac_type(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		hw->swfwhw_semaphore_present = TRUE;
>  		hw->asf_firmware_present = TRUE;
>  		break;
> @@ -896,6 +897,7 @@ em_set_media_type(struct em_hw *hw)
>  		case em_pch_cnp:
>  		case em_pch_tgp:
>  		case em_pch_adp:
> +		case em_pch_mtp:
>  		case em_82573:
>  		case em_82574:
>  			/*
> @@ -1058,6 +1060,7 @@ em_reset_hw(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		if (!hw->phy_reset_disable &&
>  		    em_check_phy_reset_block(hw) == E1000_SUCCESS) {
>  			/*
> @@ -1322,6 +1325,7 @@ em_initialize_hardware_bits(struct em_softc *sc)
>  		case em_pch_cnp:
>  		case em_pch_tgp:
>  		case em_pch_adp:
> +		case em_pch_mtp:
>  			if (hw->mac_type == em_ich8lan)
>  				/* Set TARC0 bits 29 and 28 */
>  				reg_tarc0 |= 0x30000000;
> @@ -1803,6 +1807,7 @@ em_init_hw(struct em_softc *sc)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		/*
>  		 * Old code always initialized queue 1,
>  		 * even when unused, keep behaviour
> @@ -1951,6 +1956,7 @@ em_setup_link(struct em_hw *hw)
>  		case em_pch_cnp:
>  		case em_pch_tgp:
>  		case em_pch_adp:
> +		case em_pch_mtp:
>  		case em_82573:
>  		case em_82574:
>  			hw->fc = E1000_FC_FULL;
> @@ -3167,6 +3173,7 @@ em_setup_copper_link(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		/*
>  		 * Set the mac to wait the maximum time between each
>  		 * iteration and increase the max iterations when polling the
> @@ -6085,6 +6092,7 @@ em_match_gig_phy(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		if (hw->phy_id == I217_E_PHY_ID)
>  			match = TRUE;
>  		break;
> @@ -6423,6 +6431,7 @@ em_init_eeprom_params(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		{
>  			int32_t         i = 0;
>  			uint32_t        flash_size = EM_READ_REG(hw, 0xc /* STRAP */);
> @@ -7140,6 +7149,7 @@ em_validate_eeprom_checksum(struct em_hw *hw)
>  		case em_pch_cnp:
>  		case em_pch_tgp:
>  		case em_pch_adp:
> +		case em_pch_mtp:
>  			word = EEPROM_COMPAT;
>  			valid_csum_mask = EEPROM_COMPAT_VALID_CSUM;
>  			break;
> @@ -8383,6 +8393,7 @@ em_get_bus_info(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		hw->bus_type = em_bus_type_pci_express;
>  		hw->bus_speed = em_bus_speed_2500;
>  		hw->bus_width = em_bus_width_pciex_1;
> @@ -9580,6 +9591,7 @@ em_get_auto_rd_done(struct em_hw *hw)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		while (timeout) {
>  			if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD)
>  				break;
> @@ -9983,6 +9995,7 @@ em_valid_nvm_bank_detect_ich8lan(struct em_hw *hw, uint32_t *bank)
>  	case em_pch_cnp:
>  	case em_pch_tgp:
>  	case em_pch_adp:
> +	case em_pch_mtp:
>  		bank1_offset = hw->flash_bank_size * 2;
>  		act_offset = E1000_ICH_NVM_SIG_WORD * 2;
>  
> diff --git sys/dev/pci/if_em_hw.h sys/dev/pci/if_em_hw.h
> index 62abe8098b6..b18514f3619 100644
> --- sys/dev/pci/if_em_hw.h
> +++ sys/dev/pci/if_em_hw.h
> @@ -85,6 +85,7 @@ typedef enum {
>      em_pch_cnp,
>      em_pch_tgp,
>      em_pch_adp,
> +    em_pch_mtp,
>      em_num_macs
>  } em_mac_type;
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.