diff --git a/drivers/ethernet/nxp_enet/eth_nxp_enet.c b/drivers/ethernet/nxp_enet/eth_nxp_enet.c index b1c592dea4d5b9..fa6e04d3db3754 100644 --- a/drivers/ethernet/nxp_enet/eth_nxp_enet.c +++ b/drivers/ethernet/nxp_enet/eth_nxp_enet.c @@ -634,20 +634,25 @@ static inline void nxp_enet_fused_mac(uint8_t *mac_addr) #ifdef CONFIG_SOC_FAMILY_NXP_IMXRT uint32_t mac_addr_fuse[2] = {0}; - OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE, #if defined(CONFIG_SOC_SERIES_IMXRT10XX) - 0x620, + OCOTP_Init((OCOTP_Type *)OCOTP_BASE, CLOCK_GetIpgFreq()); + /* OTP bank 4, word 2: MAC0 */ + OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE, + 0x22, &mac_addr_fuse[0], 1); + /* OTP bank 4, word 3: MAC1*/ + OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE, + 0x23, &mac_addr_fuse[1], 1); #elif defined(CONFIG_SOC_SERIES_IMXRT11XX) - 0xA90, + OCOTP_Init((OCOTP_Type *)OCOTP_BASE, 0); + OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE, + 0x28, &mac_addr_fuse[0], 2); #endif - mac_addr_fuse, 2); - mac_addr[0] = mac_addr_fuse[0] & 0x000000FF; - mac_addr[1] = mac_addr_fuse[0] & 0x0000FF00; - mac_addr[2] = mac_addr_fuse[0] & 0x00FF0000; - mac_addr[3] = mac_addr_fuse[0] & 0xFF000000; - mac_addr[4] = mac_addr_fuse[1] & 0x00FF; - mac_addr[5] = mac_addr_fuse[1] & 0xFF00; + mac_addr[1] = (mac_addr_fuse[0] & 0x0000FF00) >> 8; + mac_addr[2] = (mac_addr_fuse[0] & 0x00FF0000) >> 16; + mac_addr[3] = (mac_addr_fuse[0] & 0xFF000000) >> 24; + mac_addr[4] = (mac_addr_fuse[1] & 0x00FF); + mac_addr[5] = (mac_addr_fuse[1] & 0xFF00) >> 8; #else ARG_UNUSED(mac_addr); #endif